<!DOCTYPE html>
<!-- saved from url=(0047)http://www.w3.org/TR/2012/REC-widgets-20121127/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Packaged Web Apps (Widgets) - Packaging and XML Configuration (Second Edition)</title>
<style type="text/css">
/*<![CDATA[*/

  body {
	font-size: 1em;
	counter-reset: assertion;
}
span {
	border: 1px dotted #C3C;
}
dfn.external {
	font-weight: normal;
	font-style: italic;
}
pre.idl {
	border:solid thin;
	background:#eee;
	color:#000;
	padding:0.5em
}
pre.idl :link, pre.idl :visited {
	color:inherit;
	background:transparent
}
dfn {
	font-style:normal;
	font-weight:bolder;
}
em.ct, em.ct-samp {
	text-transform:uppercase;
	font-style:normal;
	font-weight:normal;
}
.issue {
	padding:1em;
	border: 1px solid red;
	background:#FFC;
}
.example {
	border-left: double;
	background-color: #fafafa;
}
.note {
	margin-left: 2em;
	border: 2px solid #CFF6D9;
	padding: .5em;
	padding-top: 0px;
	padding-bottom: 1em;
	color: #444;
	background-color: #E2FFF0;
	font-size: 0.8em;
}
dd > dl {
	margin:0px;
	padding:0px
}
code {
	font-size: 1.1em;
	text-decoration: none;
	color: #002108;
}
a:link code, a:visited code, a > code {
	color:green;
	text-decoration: none;
	border-bottom: 0;
}
.dir_listing li {
	list-style-type:none;
	font-family: Tahoma, Arial, Helvetica, sans-serif;
}
span span {
	background-color: yellow;
}
li.folder {
	list-style-image:url(images/expanded_folder.png)
}
.authorguide {
	border: 1px solid #67BBB5;
	background:#E8EBFC;
	padding: 1em;
	font-size: .9em;
	color: #003;
}
.authorguide strong {
	padding: .2em;
	color: #003;
	border: none;
	position:relative;
	display: block;
	width: 200px;
	left: -1.5em;
	top: -1.5em;
	background: #C6D8E6;
	text-align: center;
}
span.notetitle {
	padding: .2em;
	color:#066;
	border: none;
	position:relative;
	display: block;
	width: 40px;
	left: -1.5em;
	top: -.7em;
	background: #F2FFF1;
	padding-left: .2em;
	text-align: center;
}
var {
	font-family: "Lucida Console", Monaco, monospace;
}
li.folder li {
	list-style-image: none;
}
.dir_listing .comment {
	border: none;
	font-family:"Courier New", Courier, monospace;
	color: #669933;
}
.dir_listing img {
	vertical-align: middle;
}
.redNote {
	color: red;
}
dl.procedure dt {
	font-weight: normal;
}
.editorialNote {
	padding: 5px;
	background-color: #F3B9B7;
	border: 3px dashed #FFEEB8;
	color: #444;
	font-size:0.8em;
}
li>ol {
	list-style-type:upper-alpha;
}
.toc li>ol {
	list-style: none !important;
}
p[id]:after {
	font-size: .8em;
	content: " {" attr(id) "}";
}
.example p {
	margin-top: 1em;
}
td, th {
	border: 1px solid black;
}

/*
 @media screen and (view-mode:minimized) {
 body, .head {
 margin: 0px !important;
 padding: 10px !important;
 background-position: 0px -20px !important;
 text-shadow: #EEE 2px 2px 2px;
}
 .body, .copyright, .head dl, hr {
 display: none;
}
 .head {
 text-align: center;
 padding-top: 10px;
}
 .head h1, .head p {
 margin: 0px;
 padding: 0px;
 background-color: transparent;
}
 .head h2 {
 text-align: center;
 font-size: 1em;
 background-color: transparent;
 margin-left: 20px !important;
}
}
*/

/*]]>*/
</style>
<link href="./REC-widgets-20121127_files/W3C-REC" rel="stylesheet" type="text/css">
</head>
<body>
<div class="head">
  <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="./REC-widgets-20121127_files/w3c_home" width="72"></a></p>
  <!--end-logo-->
  <h1 class="head">Packaged Web Apps (Widgets) -  Packaging and XML Configuration (Second Edition)</h1>
  <h2 class="no-num no-toc" id="w3c-recommendation-15-november-2012">W3C Recommendation 27 November 2012</h2>
  <dl>
    <dt>This version:</dt>
    <dd class="publish"><a href="./REC-widgets-20121127_files/REC-widgets-20121127.html">http://www.w3.org/TR/2012/REC-widgets-20121127/</a>
    </dd><dt>Latest version:</dt>
    <dd><a href="http://www.w3.org/TR/widgets/">http://www.w3.org/TR/widgets/</a></dd>
    <dt>Previous versions:</dt>
    <dd><a href="http://www.w3.org/TR/2012/PER-widgets-20120925/">http://www.w3.org/TR/2012/PER-widgets-20120925/</a></dd>
    <dd><a href="http://www.w3.org/TR/2011/REC-widgets-20110927/">http://www.w3.org/TR/2011/REC-widgets-20110927/</a></dd>
    <dt>Latest  editor's draft:</dt>
    <dd><a href="http://w3c.github.com/packed-webapps/packaging/">http://w3c.github.com/packed-webapps/packaging/</a></dd>
    <dt>Test suite:</dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets/test-suite/">http://dev.w3.org/2006/waf/widgets/test-suite/</a></dd>
    <dt>Implementation report:</dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets/imp-report/">http://dev.w3.org/2006/waf/widgets/imp-report/</a></dd>
    <dt>Editor:</dt>
    <dd><a href="http://datadriven.com.au/">Marcos Cáceres</a>, W3C Invited Expert</dd>
  </dl>
  <p>Please refer to the <a href="http://dev.w3.org/2006/waf/widgets/errata.html"><strong>errata</strong></a> for this document, which  includes some normative corrections.</p>
  <p>See also <a href="http://www.w3.org/2003/03/Translations/byTechnology?technology=widgets"> <strong>translations</strong></a>.</p>
  <p>See also <a href="http://www.w3.org/2007/10/htmldiff?doc1=http%3A//www.w3.org/TR/widgets/&doc2=http%3A//www.w3.org/TR/2011/REC-widgets-20110927/">differences</a> between this and last published
  draft and this document.</p>
  <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
</div>
<hr>
<div class="body">
  <h2 class="no-num no-toc" id="abstract">Abstract</h2>
  <p>This specification updates the <cite>Widget Packaging and XML Configuration</cite>, and addresses some <a href="http://dev.w3.org/2006/waf/widgets/errata.html">errata</a> found in the original recommendation. It also updates the name of the specification, to be more <em>in vogue</em> with industry trends towards the naming of this class of application.</p>
  <p>This specification standardizes a packaging format and metadata for a  class of software
    known commonly as <em>packaged apps</em> or <em>widgets</em>. Unlike traditional user interface widgets (e.g., buttons, input boxes, toolbars, etc.), widgets as specified in this document are full-fledged client-side applications that are authored
    using technologies such as HTML and then packaged for distribution. Examples range from
    simple clocks, stock tickers, news casters, games and weather forecasters, to complex
    applications that pull data from multiple sources to be "mashed-up" and presented to a
    user in some interesting and useful way.</p>
  <p>The
    specification relies on PKWare's Zip specification as the archive format, XML as a
    configuration document format, and a series of steps that runtimes follow when
    processing and verifying various aspects of a package. The packaging format acts as a
    container for files used by a widget. The configuration document is an XML vocabulary
    that declares metadata and configuration parameters for a widget. The steps for
    processing a widget package describe the expected behavior and means of error handling
    for runtimes while processing the packaging format, configuration document, and other
    relevant files. </p>
  <p>This specification is part of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-family-of-specifications">Widgets family of specifications</a>,
    which together standardize widgets as a whole.</p>
  <h2 class="no-num no-toc" id="sotd">Status of this Document </h2>
  <p><em>This section describes the status of this document at the time of its
  publication. Other documents may supersede this document. A list of current W3C
  publications and the latest revision of this technical report can be found in the
  <a href="http://www.w3.org/TR/">W3C technical reports index</a> at
  http://www.w3.org/TR/.</em>  </p>
  <p>This is the 27 November 2012 Recommendation of the <cite>Widget Packaging and XML Configuration</cite> specification. This document is produced by the <a href="http://www.w3.org/2008/webapps/">Web
    Applications WG</a>, part of the <a href="http://www.w3.org/2006/rwc/Activity">Rich Web
      Client Activity</a> in the W3C <a href="http://www.w3.org/Interaction/">Interaction
  Domain</a>.  </p>
  <p>This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</p>
  <p>The public is encouraged to send comments to the WebApps Working Group's public mailing list <a href="mailto:public-webapps@w3.org">public-webapps@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/public-webapps/">archive</a>).  </p>
  <p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
    Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the
    deliverables of the group; that page also includes instructions for disclosing a
    patent. An individual who has actual knowledge of a patent which the individual
    believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
      Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
  W3C Patent Policy</a>.</p>
  <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
  
<!--begin-toc-->
<ol class="toc">
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#introduction"><span class="secno">1 </span>Introduction</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#design-goals-and-requirements"><span class="secno">1.1 </span>Design Goals and Requirements</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#how-this-document-is-organized"><span class="secno">1.2 </span>How This Document is Organized</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#typographic-conventions"><span class="secno">1.3 </span>Typographic Conventions</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-family-of-specifications"><span class="secno">1.4 </span>The Widget Family of Specifications</a></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#conformance"><span class="secno">2 </span>Conformance</a></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#definitions"><span class="secno">3 </span>Definitions</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#character-definitions"><span class="secno">3.1 </span>Character Definitions</a></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agents"><span class="secno">4 </span>User Agents</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#optional-aspects-of-the-zip-specification"><span class="secno">4.1 </span>Optional Aspects of the Zip Specification</a></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive"><span class="secno">5 </span>Zip Archive</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#compression-methods"><span class="secno">5.1 </span>Compression Methods</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#version-of-zip-needed-to-extract-a-file-entry"><span class="secno">5.2 </span>Version of Zip Needed to Extract a File Entry</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-paths"><span class="secno">5.3 </span>Zip Relative Paths</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#interoperability-considerations"><span class="secno">5.4 </span>Interoperability Considerations</a></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-packages"><span class="secno">6 </span>Widget Packages</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package"><span class="secno">6.1 </span>Invalid Widget Package</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#files-and-folders"><span class="secno">6.2 </span>Files and Folders</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved-file-and-folder-names"><span class="secno">6.3 </span>Reserved File and Folder Names</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#digital-signatures"><span class="secno">6.4 </span>Digital Signatures</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-files"><span class="secno">6.5 </span>Start Files</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file"><span class="secno">6.5.1 </span>Custom Start File</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files"><span class="secno">6.5.2 </span>Default Start Files</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icons"><span class="secno">6.6 </span>Icons</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icons"><span class="secno">6.6.1 </span>Custom Icons</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons"><span class="secno">6.6.2 </span>Default Icons</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type"><span class="secno">6.7 </span>Media Type</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-extension"><span class="secno">6.8 </span>File Extension</a></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document"><span class="secno">7 </span>Configuration Document</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-configuration-document"><span class="secno">7.1 </span>Example Configuration Document</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#namespace"><span class="secno">7.2 </span>Namespace</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#proprietary-extensions"><span class="secno">7.3 </span>Proprietary Extensions</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#types-of-attributes"><span class="secno">7.4 </span>Types of Attributes</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes"><span class="secno">7.5 </span>Global Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute"><span class="secno">7.5.1 </span>The <code>xml:lang</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute"><span class="secno">7.5.2 </span>The <code>dir</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#examples-of-usage"><span class="secno">7.5.3 </span>Examples of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes"><span class="secno">7.6 </span>The <code>widget</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-id-attribute"><span class="secno">7.6.1 </span>The <code>id</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-version-attribute"><span class="secno">7.6.2 </span>The <code>version</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute"><span class="secno">7.6.3 </span>The <code>height</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute"><span class="secno">7.6.4 </span>The <code>width</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-viewmodes-attribute"><span class="secno">7.6.5 </span>The <code>viewmodes</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-defaultlocale-attribute"><span class="secno">7.6.6 </span>The <code title="widget defaultlocale">defaultlocale</code> attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage"><span class="secno">7.6.7 </span>Example of Usage</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-of-the-defaultlocale-attribute"><span class="secno">7.6.8 </span>Example of Usage of the <code title="widget defaultlocale">defaultlocale</code> attribute </a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes"><span class="secno">7.7 </span>The <code>name</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute"><span class="secno">7.7.1 </span>The <code title="name short">short</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-0"><span class="secno">7.7.2 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes"><span class="secno">7.8 </span>The <code>description</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-1"><span class="secno">7.8.1 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes"><span class="secno">7.9 </span>The <code title="">author</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute"><span class="secno">7.9.1 </span>The <code>href</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute"><span class="secno">7.9.2 </span>The <code>email</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-2"><span class="secno">7.9.3 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes"><span class="secno">7.10 </span>The <code>license</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0"><span class="secno">7.10.1 </span>The <code>href</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-3"><span class="secno">7.10.2 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes"><span class="secno">7.11 </span>The <code>icon</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute"><span class="secno">7.11.1 </span>The <code>src</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0"><span class="secno">7.11.2 </span>The <code>width</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0"><span class="secno">7.11.3 </span>The <code>height</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-4"><span class="secno">7.11.4 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes"><span class="secno">7.12 </span>The <code>content</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0"><span class="secno">7.12.1 </span>The <code>src</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute"><span class="secno">7.12.2 </span>The <code>type</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute"><span class="secno">7.12.3 </span>The <code>encoding</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-5"><span class="secno">7.12.4 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes"><span class="secno">7.13 </span>The <code>feature</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute"><span class="secno">7.13.1 </span>The <code title="feature name">name</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute"><span class="secno">7.13.2 </span>The <code>required</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-6"><span class="secno">7.13.3 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes"><span class="secno">7.14 </span>The <code>param</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0"><span class="secno">7.14.1 </span>The <code>name</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute"><span class="secno">7.14.2 </span>The <code>value</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-7"><span class="secno">7.14.3 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes"><span class="secno">7.15 </span>The <code>preference</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1"><span class="secno">7.15.1 </span>The <code>name</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0"><span class="secno">7.15.2 </span>The <code>value</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-readonly-attribute"><span class="secno">7.15.3 </span>The <code>readonly</code> Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-8"><span class="secno">7.15.4 </span>Example of Usage</a></li></ol></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes"><span class="secno">7.16 </span>The <code>span</code> Element and its Attributes</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#example-of-usage-9"><span class="secno">7.16.1 </span>Example of Usage</a></li></ol></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#internationalization-and-localization"><span class="secno">8 </span>Internationalization and localization</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidirectional-text"><span class="secno">8.1 </span>Bidirectional  text</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localization-model"><span class="secno">8.2 </span>Localization Model</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization"><span class="secno">8.3 </span>Folder-based localization</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization"><span class="secno">8.4 </span>Element-Based Localization</a></li>
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localization-examples"><span class="secno">8.5 </span>Localization Examples</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#simple-example"><span class="secno">8.5.1 </span>Simple Example</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#complex-example"><span class="secno">8.5.2 </span>Complex Example</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#fallback-behavior-example"><span class="secno">8.5.3 </span>Fallback Behavior Example</a></li></ol></li></ol></li>
 <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package"><span class="secno">9 </span>Steps for Processing a Widget Package</a>
  <ol class="toc">
   <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processing-rules"><span class="secno">9.1 </span>Processing Rules</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-zip-archive"><span class="secno">9.1.1 </span>Rule for Verifying a Zip Archive</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-extracting-file-data-from-a-file-entry"><span class="secno">9.1.2 </span>Rule for Extracting File Data from a File Entry</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package"><span class="secno">9.1.3 </span>Rule for Finding a File Within a Widget Package</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-directionality"><span class="secno">9.1.4 </span>Rule for Determining Directionality</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value"><span class="secno">9.1.5 </span>Rule for Getting a Single Attribute Value</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-list-of-keywords-from-an-attribute"><span class="secno">9.1.6 </span>Rule for Getting a List of Keywords From an Attribute</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-file-entry"><span class="secno">9.1.7 </span>Rule for Verifying a File Entry</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content"><span class="secno">9.1.8 </span>Rule for Getting Text Content</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-with-normalized-white-space"><span class="secno">9.1.9 </span>Rule for Getting Text Content with Normalized White Space</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-parsing-a-non-negative-integer"><span class="secno">9.1.10 </span>Rule for Parsing a Non-negative Integer</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file"><span class="secno">9.1.11 </span>Rule for Identifying the Media Type of a File</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-deriving-the-user-agent-locales"><span class="secno">9.1.12 </span>Rule for Deriving the <var title="">user agent locales</var></a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive"><span class="secno">9.1.13 </span>Rule for Determining if a Potential Zip Archive is a Zip
    Archive</a></li></ol></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-1-acquire-a-potential-zip-archive">Step 1 - Acquire a Potential Zip Archive</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acquisition-of-a-potential-zip-archive-labeled-with-a-media-type"><span class="secno">9.1.1 </span>Acquisition of a Potential Zip archive Labeled with a Media Type</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acquisition-of-potential-zip-archive-not-labeled-with-a-media-type"><span class="secno">9.1.2 </span>Acquisition of Potential Zip Archive not Labeled with a Media
    Type</a></li></ol></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive">Step 2 - Verify the Zip Archive</a></li>
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-3-set-the-configuration-defaults">Step 3 - Set the Configuration Defaults</a></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-4-locate-and-process-the-digital-signature">Step 4 - Locate and Process the Digital Signature</a></li>
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-5-derive-the-user-agent's-locales">Step 5 - Derive the User Agent's Locales</a></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-6-locate-the-configuration-document">Step 6 - Locate the Configuration Document</a></li>
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7 - Process the Configuration
    Document</a>
    <ol class="toc">
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#terminology-used-in-processing-algorithm"><span class="secno">9.1.1 </span>Terminology Used in Processing Algorithm</a></li>
     <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#algorithm-to-process-a-configuration-document"><span class="secno">9.1.2 </span>Algorithm to Process a Configuration Document</a></li></ol></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-8-locate-the-start-file">Step 8 - Locate the Start File</a></li>
   <li><a class="no-num done" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-9-process-the-default-icons">Step 9 - Process the Default Icons</a></li></ol></li>
 <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#appendix">Appendix</a>
  <ol class="toc">
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-registration-for-application/widget">Media Type Registration for <code>application/widget</code></a></li>
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#linking-to-a-widget-package-from-a-html-document">Linking To a Widget Package From a HTML Document</a></li>
   <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-elements-and-their-attributes">Table of Elements and Their Attributes</a></li></ol></li>
 <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acknowledgements">Acknowledgements</a></li>
 <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#normative-references">Normative References</a></li>
 <li><a class="no-num" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#informative-references">Informative References</a></li></ol>
<!--end-toc-->
  <h2 id="introduction"><span class="secno">1 </span>Introduction</h2>
  <p><em>This section is non-normative.</em></p>
  <p><em>Widgets</em> are full-fledged client-side applications that are authored using
    Web standards such as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">[HTML]</a> and packaged for distribution. They are typically downloaded and
    installed on a client machine or device where they run as stand-alone applications, but
    they can also be embedded into Web pages and run in a Web browser. Examples range from
    simple clocks, stock tickers, news casters, games and weather forecasters, to complex
    applications that pull data from multiple sources to be "mashed-up" and presented to a
    user in some interesting and useful way (see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-landscape">[Widgets-Landscape]</a> for more
    information).</p>
  <p>This specification is intended to specify a part of the Web platform closely related to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">[HTML]</a>. </p>
  <h3 id="design-goals-and-requirements"><span class="secno">1.1 </span>Design Goals and Requirements</h3>
  <p><em>This section is non-normative.</em></p>
  <p>The design goals and requirements for this specification are documented in the<cite> </cite><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-requirements">[Widgets-Requirements]</a> document. </p>
  <p>This document addresses
    the 25 requirements relating to "<a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#widget-package-packaging">Packaging</a>" and "<a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#configuration-document">Configuration Document</a>" of the 30 April 2009 Working Draft of the <cite>Widgets Requirements</cite> Document: </p>
  <ol>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#packaging-format">Packaging
      Format</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#packaging-format">packaging format</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#media-type">Media
      Type</a>: see the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-widget-media-type">valid widget media type</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#file-extension">File
      Extension</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-file-extension">widget file extension</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#internal-abstract-structure">Internal
      Abstract Structure</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget
      package</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#reserved-resource-names">Reserved
      Resource Names</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved-file-names-table">reserved file names table</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#addressing-scheme">Addressing
      Scheme</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#multilingual-file-names">Multilingual
      File Names</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip relative path</a>, particularly in respect to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> for <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#localization-guidelines">Localization
      Guidelines</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based
      localization</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#automatic-localization">Automatic
      Localization</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based
      localization</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#device-independent-delivery">Device
      Independent Delivery</a>: all aspects of this document where developed with this
      requirement in mind.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#data-compression">Data
      Compression</a>: see the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-compression-methods">valid compression methods</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#derive-the-media-type-of-resources"> Derive the Media Type of Resources</a>: see the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a
      file</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#format-and-schema">Format and
      Schema</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of configuration
      defaults</a>, and the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-relax-ng-schema">[Widgets-Relax NG Schema]</a> for the configuration
      document.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#widget-metadata">Widget
      Metadata</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (particularly the
      elements).</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#authorship-metadata">Authorship
      Metadata:</a> see the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#copyright-notice-and-license-metadata"> Copyright Notice and License Metadata</a>: see the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#visual-rendering-dimensions">Visual
      Rendering Dimensions</a>: see the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#declarative-bootstrap">Declarative
      Bootstrap</a> see the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#automated-bootstrap">Automated
      Bootstrap</a> see the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">default start file</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#iconic-representations">Iconic
      Representations</a>: see the <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons table</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icon" title="custom icon">custom icons
      table</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#configuration-parameters">Configuration
      Parameters</a>: the <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element (used in
      conjunction with the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element).</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#author-defined-start-up-values-preferences"> Author-defined Start-up Values (Preferences)</a>: see the <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#feature-access-declarations">Feature
      Access Declarations</a>: see the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#configuration-document-independence"> Configuration Document Independence</a>: see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
      document</a>.</li>
    <li><a href="http://www.w3.org/TR/2009/WD-widgets-reqs-20090430/#preferred-display-mode">Preferred
      Display Mode</a>: see the <code>viewmodes</code> attribute of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</li>
  </ol>
  <h3 id="how-this-document-is-organized"><span class="secno">1.2 </span>How This Document is Organized</h3>
  <p><em>This section is non-normative.</em></p>
  <p>This document is organized into two halves, but not
    explicitly marked as such. The first half defines the various aspects of what
    constitutes the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#packaging-format">packaging format</a>, the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>,
    and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> files, such as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon" title="default icon">default
    icons</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a>. Where possible, the first
    half avoids describing aspects related to processing, which are described in detail in
    the second half of the document.</p>
  <p>The second half, which starts with the section titled "<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">Steps for Processing a
    widget package</a>", defines the steps required to process a widget package as well
    as the expected behavior of a user agent as it processes the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#packaging-format">packaging format</a>, the
    configuration document, and attempts to find localized content. The second half of this
    document also deals with error handling in the event that a user agent encounters <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> or missing files, or <abbr title="Document Object Model">DOM</abbr> nodes that are <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> in the
    configuration document. Wherever processing is relevant, sections in the first half of
    the document link to sections in the second half of the document.</p>
  <h3 id="typographic-conventions"><span class="secno">1.3 </span>Typographic Conventions</h3>
  <p><em>This section is non-normative.</em></p>
  <p>This section defines the <dfn id="typographical-conventions">typographical conventions</dfn> used by this
    specification. Some text in this specification is non-normative. Non-normative text includes:</p>
  <ul>
    <li>sections marked with the text <q><em>This section is non-normative</em></q>,</li>
    <li>authoring guidelines,</li>
    <li>examples,</li>
    <li>and notes.</li>
  </ul>
  <p>Everything else in this specification is normative.</p>
  <p>Defined terms appear as this <dfn id="sample-defined-term">sample defined
    term</dfn>. Such terms are referenced as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sample-defined-term">sample defined term</a>, providing a
    link back to the term definition.</p>
  <p>Words that denote a conformance clause or testable assertion use keywords from <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rfc2119">[RFC2119]</a>: <em class="ct-samp">must</em>, <em class="ct-samp">must not</em>, <em class="ct-samp">should</em>, <em class="ct-samp">recommended</em>, <em class="ct-samp">may</em> and <em class="ct-samp">optional</em>. The keywords <dfn title=""><em class="ct-samp">must</em></dfn>, <dfn title=""><em class="ct-samp">must not</em></dfn>, <dfn title=""><em class="ct-samp">should</em></dfn>, <dfn title=""><em class="ct-samp">recommended</em></dfn>, <dfn title=""><em class="ct-samp">may</em></dfn> and <dfn title=""><em class="ct-samp">optional</em></dfn> in this specification are to be interpreted as described in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rfc2119">[RFC2119]</a>.</p>
  <p>Variables are formatted specially, e.g. <var>variable</var>. Code is also specially
    formatted, such as <code>code</code>.</p>
  <p>Words in <dfn class="external" id="italics">italics</dfn> denote a formal definition given in an
    external specification.</p>
  <p class="example">This is an example. Examples are used to explain concepts or
    demonstrate how to use a feature. Examples are non-normative.</p>
  <p class="note"><span class="notetitle">Note:</span> This is a note, it usually
    contains useful supplementary information in a non-normative form.</p>
  <p class=" authorguide"><strong>Authoring Guidelines:</strong> This is an Authoring
    Guideline. Its purpose is to provide authors with best-practice authoring techniques.
    Authoring guidelines are non-normative.</p>
  <h3 id="the-widget-family-of-specifications"><span class="secno">1.4 </span>The Widget Family of Specifications</h3>
  <p><em>This section is non-normative.</em></p>
  <p>This specification is part of the <dfn id="widgets-family-of-specifications">Widgets family of specifications</dfn>,
    which together standardize widgets as a whole. The <a href="http://www.w3.org/2008/webapps/wiki/WidgetSpecs">list of specifications</a> that make up the Widgets  Family of Specifications can be found on the Working Group's wiki. </p>
  <h2 id="conformance"><span class="secno">2 </span>Conformance</h2>
  <p>There is only one class of  product that can claim conformance to this
    specification: a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a>.</p>
  <p class="note"> <span class="notetitle">Note:</span> Implementers can partially check their level of conformance to this specification by successfully passing the test cases of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-test-suite">[P&amp;C-Test-Suite]</a>. Note, however, that passing all the tests in the test suite does not imply complete conformance to this specification; It only implies that the implementation conforms to aspects tested by the test suite (the test suite does not provide tests for any optional conformance clauses).</p>
  <h2 id="definitions"><span class="secno">3 </span>Definitions</h2>
  <p>The following terms are used throughout this specification so they are gathered here for the readers convenience. The following list of terms is not exhaustive; other terms are defined throughout this specification.</p>
  <p><dfn id="arbitrary">Arbitrary</dfn> means that a character, or text string, or <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name">file-name</a></code>, or <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-name">folder-name</a></code> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> for
    the purpose of this specification.</p>
  <p>An <dfn id="author">author</dfn> is a person who created a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> or an
    authoring tool that generated a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</p>
  <p><dfn id="initialization">Initialization</dfn> means a user agent procedurally stepping through the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for processing a widget
    package</a>.</p>
  <p>A <dfn class="external" id="language-tag">language tag</dfn> is a text string that matches the production of a <code>Language-Tag</code> defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a> specifications (see the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
    Registry</a> for an authoritative list of possible values, see also the <a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements">Maintenance Agency for ISO 3166 country codes</a>). </p>
  <p>A <dfn class="external" id="media-type-0">media type</dfn> is defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime">[MIME]</a> specification.</p>
  <p><dfn id="reserved">Reserved</dfn> means that a character, or text string, or <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name">file-name</a></code>, or <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-name">folder-name</a></code> has a specified purpose and
    semantics in this specification or in some other specification or system. The intended
    purpose for any reserved thing is given when the term is used.</p>
  <p><dfn id="supported">Supported</dfn> means that a user agent implements a mentioned specification,
    or conformance clause, or is able to process or otherwise render mentioned <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media
    type</a>.</p>
  <p><dfn id="unsupported">Unsupported</dfn> means the user agent does not implement a mentioned
    specification, or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>, or is unable to render or otherwise process a
    mentioned <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a>.</p>
  <p>A <dfn class="external" id="widget">widget</dfn> is defined by the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-landscape">[Widgets-Landscape]</a> as <q>an
    end-user's conceptualization of an interactive single purpose application for
    displaying and/or updating local data or data on the Web, packaged in a way to allow a
    single download and installation on a user's machine, mobile phone, or Internet-enabled
    device</q>. Because widgets are packaged, they can be shared by users without relying
    on <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#http">[HTTP]</a>. </p>
  <h3 id="character-definitions"><span class="secno">3.1 </span>Character Definitions</h3>
  <p>This section groups common sets of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a> code points into definitions for the purpose processing in this
    specification. </p>
  <p>The <dfn id="space-characters" title="space characters">space characters</dfn>  are code points marked in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a> specification with the property "White_Space", including, but not limited to the following list (see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a> for the authoritive list):</p>
  <ul>
    <li>U+0020 SPACE,</li>
    <li>U+0009 CHARACTER TABULATION (tab),</li>
    <li>U+000A LINE FEED (LF),</li>
    <li>U+000B LINE TABULATION,</li>
    <li>U+000C FORM FEED (FF),</li>
    <li>U+000D CARRIAGE RETURN (CR).</li>
    <li>U+0085 NEL (control character next line)</li>
    <li>U+00A0 NBSP (NO-BREAK SPACE)</li>
    <li>U+1680 OGHAM SPACE MARK</li>
    <li>U+180E MONGOLIAN VOWEL SEPARATOR</li>
    <li>U+2000-U+200A (different sorts of spaces)</li>
    <li>U+2028 LS (LINE SEPARATOR)</li>
    <li>U+2029 PS (PARAGRAPH SEPARATOR)</li>
    <li>U+202F NNBSP (NARROW NO-BREAK SPACE)</li>
    <li>U+205F MMSP (MEDIUM MATHEMATICAL SPACE)</li>
    <li>U+3000 IDEOGRAPHIC SPACE</li>
  </ul>
  <p>The <dfn id="zip-forbidden-characters">Zip forbidden
    characters</dfn> are code points:</p>
  <ul>
    <li>U+0000 NUL-U+001F INFORMATION SEPARATOR 1,</li>
    <li>U+007F DELETE,</li>
    <li>U+003C LESS-THAN SIGN,</li>
    <li>U+003E GREATER-THAN SIGN,</li>
    <li>U+003A COLON,</li>
    <li>U+0022 QUOTATION MARK,</li>
    <li>U+002F SOLIDUS,</li>
    <li>U+005C REVERSE SOLIDUS,</li>
    <li>U+007C VERTICAL LINE,</li>
    <li>U+003F QUESTION MARK,</li>
    <li>U+002A ASTERISK,</li>
    <li>U+005E CIRCUMFLEX ACCENT,</li>
    <li>U+0060 GRAVE ACCENT,</li>
    <li>U+007B LEFT CURLY BRACKET,</li>
    <li>U+007D RIGHT CURLY BRACKET,</li>
    <li>U+0021 EXCLAMATION MARK.</li>
  </ul>
  <h2 id="user-agents"><span class="secno">4 </span>User Agents</h2>
  <p>A <dfn id="user-agent">user agent</dfn> is an implementation of this specification that also <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xmlns">[XMLNS]</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#dom3core">[DOMCore]</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sniff">[SNIFF]</a>, and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> (see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#optional-aspects-of-the-zip-specification-0">optional aspects of the Zip specification</a>). </p>
  <p>In addition to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package" title="widget package">widget packages</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">may</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> other legacy and proprietary application packaging formats. </p>
  <p>It is <em class="ct">optional</em> for a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user
    agent</a> to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#optional-aspects-of-the-zip-specification-0">optional  aspects of the Zip specification</a>.</p>
  <p class="note"><span class="notetitle">Note:</span> The user agent described in this
    specification does not necessarily denote a "<dfn id="widget-user-agent">widget user agent</dfn>" at large:
    that is, a user agent that implements all the specifications, and dependencies, defined
    in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-family-of-specifications">Widgets Family of Specifications</a>. The user agent described is this
    specification is only concerned with how to processes <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0" title="zip archive">Zip
    archives</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0" title="configuration document">configuration
    documents</a>.</p>
  <h3 id="optional-aspects-of-the-zip-specification"><span class="secno">4.1 </span>Optional Aspects of the Zip Specification</h3>
  <p>The <dfn id="optional-aspects-of-the-zip-specification-0">optional aspects of the Zip specification</dfn> are as follows. These  aspects represent general features defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification that this specification does not make use of: </p>
  <ul>
    <li>
      <p>Compression or  decompression algorithms other than <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#deflate">[Deflate]</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#stored">Stored</a>.</p>
    </li>
    <li>
      <p>Zip64 extensions.</p>
    </li>
    <li>
      <p> Digital signature methods.</p>
    </li>
    <li>
      <p> Decryption methods.</p>
    </li>
    <li>
      <p> Patented aspects.</p>
    </li>
  </ul>
  <h2 id="zip-archive"><span class="secno">5 </span>Zip Archive</h2>
  <p> The <dfn id="zip-archive-0">Zip archive</dfn> file format,  defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification, is the <dfn id="packaging-format">packaging format</dfn> for <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package" title="widget package">widget packages</a>.</p>
  <p>A <dfn id="file-entry">file entry</dfn> is the data held by a <dfn class="external" id="local-file-header">local file
    header</dfn>, <dfn class="external" id="file-data">file data</dfn>, and (optional) <dfn class="external" id="data-descriptor">data descriptor</dfn>, as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification,
    for each physical file or folder contained in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>.</p>
  <p>A <dfn id="potential-zip-archive">potential Zip archive</dfn> is a data object claiming to be a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>,
    that has not been <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-zip-archive-0" title="rule for verifying a zip archive">verified</a> to be a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-zip-archive">valid Zip archive</a>.</p>
  <p>A <dfn id="valid-zip-archive">valid Zip archive</dfn> is a  data object that the user agent has verified as conforming to the production of a <dfn class="external" id=".zip-file">.Zip file</dfn> as defined by
    the <cite>Zip File Format Specification</cite> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive" title="step 2">meets the requirements of this specification</a> (See <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive">Step 2</a>).</p>
  <p>The <dfn id="magic-numbers-for-a-zip-archive">magic numbers for a Zip
    archive</dfn> is the byte sequence: <code>50 4B 03 04</code>.</p>
  <h3 id="compression-methods"><span class="secno">5.1 </span>Compression Methods</h3>
  <p>A <dfn id="compression-method">compression method</dfn> is the compression algorithm or storage method
    that was used to encode the file data of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> when the zip archive was created by the author. The compression method
    that  encoded the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-data">file data</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> is
    identified by the numeric value derived from the <dfn id="compression-method-field"><var>compression method
    field</var></dfn> defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification.</p>
  <p>The <dfn id="valid-compression-methods">valid compression methods</dfn>, as indicated by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#compression-method-field">compression
    method field</a></var>, for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> are:</p>
  <dl>
    <dt><code>8</code></dt>
    <dd>Data is compressed using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#deflate">[Deflate]</a>.</dd>
    <dt><code>0</code></dt>
    <dd>Data is <dfn class="external" id="stored">Stored</dfn> (no compression), as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification.</dd>
  </dl>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> To ensure
    interoperability, compress <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry" title="file entry">file entries</a> in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0" title="zip archive">Zip archives</a> with <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#deflate">[Deflate]</a> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#stored">Stored</a> (no compression); other compression methods can result in in the
    Zip archive being treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. Of the valid compression methods, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#deflate">[Deflate]</a> is the preferred compression method.</p>
  <h3 id="version-of-zip-needed-to-extract-a-file-entry"><span class="secno">5.2 </span>Version of Zip Needed to Extract a File Entry</h3>
  <p>The <dfn class="external" id="version-needed-to-extract"><var>version needed to extract</var></dfn> is the 2-byte
    sequence in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#local-file-header">local file header</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> that
    indicates the minimum supported version of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification
    needed to extract the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-data">file data</a>.</p>
  <p>The <dfn id="valid-versions-needed-to-extract">valid versions needed to extract</dfn> values are as follows. Each value
    is assigned one or more meanings by the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification:</p>
  <dl>
    <dt>1.0</dt>
    <dd>
      <p>Default value specified in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification.</p>
    </dd>
    <dt>2.0</dt>
    <dd>
      <p>The file data is compressed using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#deflate">[Deflate]</a>, or the file data is a folder, or the file has been encrypted using traditional PKWARE encryption.</p>
    </dd>
  </dl>
  <p class="note"><span class="notetitle">Note:</span> If the Zip archive has been
    encrypted using traditional PKWARE encryption, then the user agent will treat the Zip
    archive as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a> in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive">Step 2</a>.</p>
  <h3 id="zip-relative-paths"><span class="secno">5.3 </span>Zip Relative Paths</h3>
  <p>A <dfn id="zip-relative-path">Zip relative path</dfn> is the variable-length string derived from the <dfn class="external" id="file-name-field"><var>file name field</var></dfn> of the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#local-file-header">local file
    header</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a>.</p>
  <p class="note"><span class="notetitle">Note:</span> A Zip relative path is said to
    be relative as it stores the string that represents file and folder names relative to
    where the Zip archive was created on a file system (e.g. <samp>images/bg.png</samp>),
    as opposed to storing an absolute path (e.g. <samp>c:\images\bg.png</samp>). The
    value of a Zip relative path will generally resemble the string value of a name of
    the file or folder(s) on the device on which the Zip archive was created, but with
    the exception of the path delimiter being a U+002F SOLIDUS "/" character. Note also
    that a Zip relative path is not a URI reference; Zip relative paths need to be
    converted to URI references before they can be used in context that make use of
    URIs. </p>
  <p>A <dfn id="valid-zip-relative-path">valid Zip relative path</dfn> is one that matches the production of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-rel-path">Zip-rel-path</a></code> in the following <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#abnf">[ABNF]</a>:</p>
  <pre><code><dfn id="zip-rel-path">Zip-rel-path</dfn>   = [locale-folder] *folder-name file-name /
                 [locale-folder] 1*folder-name
<dfn id="locale-folder">locale-folder</dfn>  = %x6C %x6F %x63 %x61 %x6C %x65 %x73
                 "/" lang-tag "/"
<dfn id="folder-name">folder-name</dfn>    = file-name "/"
<dfn id="file-name">file-name</dfn>      = 1*allowed-char
<dfn id="allowed-char">allowed-char</dfn>   = safe-char / zip-UTF8-char
<dfn id="zip-utf8-char">zip-UTF8-char</dfn>  = UTF8-2 / UTF8-3 / UTF8-4
<dfn id="safe-char">safe-char</dfn>      = ALPHA  / DIGIT / SP  / "$" / "%" / 
                 "'"    / "-"   / "_" / "@" / "~" /
                 "("    / ")"   / "&amp;" / "+" / "," /
                 "="    / "["   / "]" / "."
<dfn id="utf8-2">UTF8-2</dfn>         = %xC2-DF UTF8-tail
<dfn id="utf8-3">UTF8-3</dfn>         = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
                 %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
<dfn id="utf8-4">UTF8-4</dfn>         = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
                 %xF4 %x80-8F 2( UTF8-tail )
<dfn id="utf8-tail">UTF8-tail</dfn>      = %x80-BF
<dfn id="lang-tag">lang-tag</dfn>       = primary-subtag *( "-" subtag )<br><dfn id="primary-subtag">primary-subtag</dfn> = 1*8low-alpha<br><dfn id="subtag">subtag </dfn>        = 1*8(alphanum)
<dfn id="alphanum">alphanum</dfn>       = low-alpha  / DIGIT<br><dfn id="low-alpha">low-alpha </dfn>     = %x61-7a
</code></pre>
  <p><dfn class="external" id="alpha"><code>ALPHA</code></dfn>, <dfn class="external" id="digit"><code>DIGIT</code></dfn>, and <dfn class="external" id="sp"><code>SP</code></dfn> are defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#abnf">[ABNF]</a> specification (but essentially represent
    alphanumerical characters and the U+0020 SPACE code point respectively).</p>
  <h3 id="interoperability-considerations"><span class="secno">5.4 </span>Interoperability Considerations</h3>
  <p><em>This section is non-normative.</em></p>
  <p>Some issues can arise with regards to character encodings of file names, the length of zip relative paths, and the use of certain strings as file names. This sections is intended to help authors avoid potential interoperability issues. </p>
  <div class="authorguide"><strong>Authoring Guideline</strong>
    <h4 class="no-toc" id="paths-lengths"><span class="secno">5.4.1 </span>Paths Lengths</h4>
    <p><em>This section is non-normative.</em></p>
    <p>Authors need to be aware that having
      excessively long path names (e.g. over 120 characters) can also result in
      interoperability issues on some operating systems. This is because some operating systems have restrictions on how long a path length can be, so authors should try to keep the lengths of  paths at less than 250 bytes. In addition, Unicode code points may
      require more than one byte to encode a character, which can result in a path whose
      length is less than 250 characters but whose size is greater than 250 bytes! </p>
    <h4 class="no-toc" id="character-sets"><span class="secno">5.4.2 </span>Character sets</h4>
    <p><em>This section is non-normative.</em></p>
    <p>Authors need to be aware that, at the time of publication, there are
      interoperability issues with regards to using characters outside the <code>safe-chars</code> range for file or folder names in a Zip archive when using
      Zipping tools bundled with operating systems. The interoperability issues have
      arisen from non-conforming implementations of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification
      across operating systems: very few, if any, correctly support encoding file names
      in Unicode.</p>
    <p>In the case where the Zip relative path is encoded using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>, the <a class="external" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-encoding-flag-(efs)">language encoding flag (EFS)</a> needs to be set.</p>
    <p>If an author chooses to use the <code>utf8-chars</code>, they need to thoroughly
      test their widgets on various platforms prior to distribution; otherwise it is
      suggested that authors restrict file and folder names to the <code>safe-chars</code> (characters in the US-ASCII range).</p>
    <h4 class="no-toc" id="file-names"><span class="secno">5.4.3 </span>File Names</h4>
    <p><em>This section is non-normative.</em></p>
    <p> Authors need to avoid using the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-forbidden-characters">Zip forbidden
      characters</a> when naming the files used by a widget. These characters are reserved to
      maintain interoperability across various file systems and with <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#uri">[URI]</a>s.</p>
    <p>Authors need to avoid using the following words as either a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder"><code>folder</code></a> or
      a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name"><code>file-name</code></a> in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip relative path</a> as they
      are reserved by some operating systems (case-insensitive): CON, PRN, AUX, NUL,
      COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5,
      LPT6, LPT7, LPT8, LPT9, CLOCKS$. For example, the following names are ok:
      "CON-tact.txt", "printer.lpt1", "DCOM1.pdf". However, "com3.txt" "Lpt1", "CoM9.gif"
      
      would not be.</p>
    <p>In addition,  authors need to avoid having a "." U+002E FULL STOP as the last character of a
      file or folder name as some operating systems will remove the character when the
      file is extracted from the Zip archive onto the device. Furthermore, avoid having
      the space character (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sp">SP</a>) at the start or end of a file name; and take
      caution when using the "+" U+002B PLUS SIGN, as it might cause issues on some
      operating systems.</p>
  </div>
  <h2 id="widget-packages"><span class="secno">6 </span>Widget Packages</h2>
  <p>A <dfn id="widget-package">widget package</dfn> is  a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-zip-archive">valid Zip
    archive</a> that contains the following:</p>
  <ul>
    <li>
      <p>One or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file" title="start file">start files</a>,  located at  the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> and/or at the root of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a> or referenced by a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute.</p>
    </li>
    <li>
      <p>One <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>,
        located at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a>.</p>
    </li>
    <li>
      <p>Zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon" title="default icon">icons</a>, either located at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> and/or at the root of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a> or referenced by the <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element's <code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code> attribute.</p>
    </li>
    <li>
      <p>Zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> located
        either at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> and/or in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder" title="folder">folders</a> or in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a>.</p>
    </li>
    <li>
      <p>Zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#digital-signature" title="digital signature">digital signatures</a> located at
        the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package.</a></p>
    </li>
  </ul>
  <p class="note"><span class="notetitle">Note:</span> See <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-1-acquire-a-potential-zip-archive">step 1</a> - Acquire
    a Potential Zip Archive for instructions on how to process a widget package.</p>
  <h3 id="invalid-widget-package"><span class="secno">6.1 </span>Invalid Widget Package</h3>
  <p>During the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for
    processing a widget package</a>, certain error conditions can result in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> being treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. An <dfn id="invalid-widget-package-0">invalid Widget package</dfn> is a condition whereby a Zip archive, or a file
    within the Zip archive, is deemed to be corrupt beyond recovery or is non-conforming
    to, or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> by, this specification in such a way that it would
    not be possible for the user agent to continue processing.</p>
  <h3 id="files-and-folders"><span class="secno">6.2 </span>Files and Folders</h3>
  <p>The <dfn id="root-of-the-widget-package">root of the widget package</dfn> is the top-most path level of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>. The root of the widget package contains <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder" title="folder">folders</a>, some of which are <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> (see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved-file-names-table">reserved file names table</a>).</p>
  <p>A <dfn id="file">file</dfn> is the decompressed physical representation of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file
    entry</a> (i.e., a file extracted into its physical form as it was prior to being
    added to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>).</p>
  <p>A <dfn id="folder">folder</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> matches the production of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-name"><code>folder-name</code></a> in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-zip-relative-path">valid Zip relative path</a> (the last character of the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name
    field</a></var> is a U+002F SOLIDUS) and whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#version-needed-to-extract">version needed to extract</a></var> is
    2.0.</p>
  <p>A <dfn id="processable-file">processable file</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> that:</p>
  <ul>
    <li>
      <p>Exists within the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</p>
    </li>
    <li>
      <p>When the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-file-entry-0">rule for verifying a file entry</a> is applied to the file, it
        returns <code>true</code>.</p>
    </li>
    <li>
      <p>Is of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent,
        determined applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a file</a> to the file in question. </p>
    </li>
  </ul>
  <h3 id="reserved-file-and-folder-names"><span class="secno">6.3 </span>Reserved File and Folder Names</h3>
  <p>The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved-file-names-table">reserved file names table</a>, below, contains a list of file names
    that are <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> for some purpose by this specification. The first column
    of the reserved file names table contains a case-sensitive list of file names.
    The second column of the table denotes the purpose for which the file name is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a>.</p>
  <table>
    <caption>
    <dfn id="reserved-file-names-table">Reserved File Names Table</dfn>
    </caption>
    <thead>
      <tr>
        <th>file name</th>
        <th>Type</th>
        <th>reserved for purpose</th>
      </tr>
      <tr>
        <td>config.xml</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">Configuration document</a></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>icon.png</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon">Default icon</a></td>
      </tr>
      <tr>
        <td>icon.gif</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon">Default icon</a></td>
      </tr>
      <tr>
        <td>icon.jpg</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon">Default icon</a></td>
      </tr>
      <tr>
        <td>icon.ico</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon">Default icon</a></td>
      </tr>
      <tr>
        <td>icon.svg</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon">Default icon</a></td>
      </tr>
      <tr>
        <td>index.html</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">Default start file</a></td>
      </tr>
      <tr>
        <td>index.htm</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">Default start file</a></td>
      </tr>
      <tr>
        <td>index.svg</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">Default start file</a></td>
      </tr>
      <tr>
        <td>index.xhtml</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">Default start file</a></td>
      </tr>
      <tr>
        <td>index.xht</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">Default start file</a></td>
      </tr>
      <tr>
        <td>locales</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">Container for localized content</a></td>
      </tr>
    </tbody>
  </table>
  <p>Files named using the <a href="http://www.w3.org/TR/widgets-digsig/#naming-convention-for-a-distributor-signature">naming
    convention for distributor signature</a> and the <a href="http://www.w3.org/TR/widgets-digsig/#naming-convention-for-an-author-signature">naming
    convention for an author signature</a>, as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-digsig">[Widgets-DigSig]</a> specification, are also reserved in this specification.</p>
  <div class="authorguide">
    <p><strong>Authoring Guideline:</strong> Authors are strongly encourage to package all
      files, except the reserved files and the  container for localized
      content, within a single subdirectory named, for instance, after the
      widget. This is to avoid unzipping several files into the end-user's
      current working directory. Future versions of this specification may
      include rules for locating index.html and config.xml within such
      directories.</p>
    <div class="example">
      <p>For example, best-practice for packaging a widget would look something
        like this:</p>
      <ul class="dir_listing">
        <li class="widget_icon"> <img alt="widget file: " height="16" src="./REC-widgets-20121127_files/widget.png" width="16"> boat.wgt
          <ul>
            <li class="doc_icon"><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html</li>
            <li class="doc_icon"><img alt="configuration
        document: " height="16" src="./REC-widgets-20121127_files/config.png" width="16"> config.xml</li>
            <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16">boat/
              <ul>
                <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> scripts/
                  <ul>
                    <li><img alt="script: " height="16" src="./REC-widgets-20121127_files/script.png" width="16"> engine.js</li>
                  </ul>
                </li>
                <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> images/
                  <ul>
                    <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> header.png</li>
                  </ul>
                </li>
              </ul>
            </li>
            <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> locales/
              <ul>
                <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> en-gb/
                  <ul>
                    <li><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> boat/
                      <ul>
                        <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16">images/
                          <ul>
                            <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> hearder.png</li>
                          </ul>
                        </li>
                      </ul>
                    </li>
                  </ul>
                </li>
              </ul>
            </li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
  <h3 id="digital-signatures"><span class="secno">6.4 </span>Digital Signatures</h3>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> contains a <dfn id="digital-signature">digital signature</dfn>, and hence is <dfn id="digitally-signed">digitally signed</dfn>, if the widget package contains one or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> that conform to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-digsig">[Widgets-DigSig]</a> specification. </p>
  <h3 id="start-files"><span class="secno">6.5 </span>Start Files</h3>
  <p>A <dfn id="start-file">start file</dfn> designates a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> from the widget package to be
    loaded by the user agent when it instantiates the widget. This specification defines
    two kinds of start file: <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file-0">custom start file</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">default start
    file</a>.</p>
  <h4 id="custom-start-file"><span class="secno">6.5.1 </span>Custom Start File</h4>
  <p>A <dfn id="custom-start-file-0">custom start file</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a> inside the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> identified by a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute.</p>
  <h4 id="default-start-files"><span class="secno">6.5.2 </span>Default Start Files</h4>
  <p>A <dfn id="default-start-file">default start file</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a> at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> or  at the root of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a> whose file name case-sensitively matches a file name given in the file name
    column of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a>, and whose <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> matches the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> given in the media type column of the table.</p>
  <p>It is <em class="ct">optional</em> for a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0" title="media type">media types</a> listed in
    the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a>.</p>
  <p id="ta-RRZxvvTFHx">If a user agent encounters a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> matching a file name given in the
    file name column of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a> in an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a>, then <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat that file as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> file.</p>
  <p class="example">For example,
    "<code>foo/bar/index.html</code>" would be treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a>.</p>
  <table>
    <caption>
    <dfn id="default-start-files-table">Default Start Files Table</dfn>
    </caption>
    <tbody><tr>
      <th scope="col">file name</th>
      <th scope="col">media type</th>
    </tr>
    <tr>
      <td>index.htm</td>
      <td>text/html</td>
    </tr>
    <tr>
      <td>index.html</td>
      <td>text/html</td>
    </tr>
    <tr>
      <td>index.svg</td>
      <td>image/svg+xml</td>
    </tr>
    <tr>
      <td>index.xhtml</td>
      <td>application/xhtml+xml</td>
    </tr>
    <tr>
      <td>index.xht</td>
      <td>application/xhtml+xml</td>
    </tr>
  </tbody></table>
  <p class="note"><span class="notetitle">Note:</span> See <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-8-locate-the-start-file">Step 8</a> for
    instructions on finding a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">default start file</a>.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> Always include at least
    one <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a> in a widget package.</p>
  <h3 id="icons"><span class="secno">6.6 </span>Icons</h3>
  <p>An <dfn id="icon">icon</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> that is used
    to represent the widget in various application contexts (e.g. the icon that the user
    activates to instantiate a widget, or an icon in a dock or task bar or some other visual
    context). The icon is intended to help users of visual browsers to recognize the widget
    at a glance. There are two kinds of icons defined by this specification, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icon" title="custom
      icon">custom
    icons</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon" title="default icon">default icons</a>.</p>
  <h4 id="custom-icons"><span class="secno">6.6.1 </span>Custom Icons</h4>
  <p>A <dfn id="custom-icon">custom icon</dfn> is an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icon">icon</a> explicitly declared by an author via an <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>. A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icon">custom icon</a> can be  located at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget
    package</a>, or at the root of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a>, or in an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a>.</p>
  <h4 id="default-icons"><span class="secno">6.6.2 </span>Default Icons</h4>
  <p>A <dfn id="default-icon">default icon</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icon">icon</a>, either at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> or at the root of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale
    folder</a>, whose file
    name case-sensitively and exactly matches a file name given in the file name column of
    the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons table</a>.</p>
  <table>
    <caption>
    <dfn id="default-icons-table">Default Icons Table</dfn>
    </caption>
    <tbody><tr>
      <th scope="col">file name</th>
      <th scope="col">media type</th>
    </tr>
    <tr>
      <td>icon.svg</td>
      <td>image/svg+xml</td>
    </tr>
    <tr>
      <td>icon.ico</td>
      <td>image/vnd.microsoft.icon</td>
    </tr>
    <tr>
      <td>icon.png</td>
      <td>image/png</td>
    </tr>
    <tr>
      <td>icon.gif</td>
      <td>image/gif</td>
    </tr>
    <tr>
      <td>icon.jpg</td>
      <td>image/jpeg</td>
    </tr>
  </tbody></table>
  <p>It is <em class="ct">optional</em> for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0" title="media type">media types</a> listed in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons table</a>.</p>
  <h3 id="media-type"><span class="secno">6.7 </span>Media Type</h3>
  <p>The <dfn id="valid-widget-media-type">valid widget media type</dfn> is the string <code>application/widget</code>.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> If the protocol over
    which the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> is transferred <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> the [MIME] specification (e.g. <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#http">[HTTP]</a>), then make sure that the widget
    is labeled with an <code>application/widget</code> media type. Failure to correctly
    label a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> can result in the widget package being treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <h3 id="file-extension"><span class="secno">6.8 </span>File Extension</h3>
  <div>
    <p>A <dfn id="widget-file-extension">widget file extension</dfn> is the text string that case-insensitively
      matches the string "<code>.wgt</code>"  (e.g. <code>.wgt</code>, <code>.WGt</code>, <code>.WgT</code>, etc. are all valid). </p>
    <p class="example">For example in <code>widget.WGT</code>, the <code>".WGT</code>" component is the file extension. </p>
    <p class="authorguide"><strong>Authoring Guidelines:</strong> If it is anticipated
      that the widget will be distributed by means lacking MIME support, then include the
      widget file extension. The widget file extension is not necessary if the widget
      package is labeled as a <code>application/widget</code> when served over HTTP. The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-file-extension">widget file extension</a> is required for widget packages on systems where it is customary for file names to include a file extension that symbolizes (or is associated with) a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media
      type</a>.</p>
  </div>
  <h2 id="configuration-document"><span class="secno">7 </span>Configuration Document</h2>
  <p>A <dfn id="configuration-document-0">configuration document</dfn> is an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> document that has a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element at its root that is in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-namespace">widget namespace</a>. A widget package has exactly
    one configuration document located at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root
    of the widget package</a>.</p>
  <p class="note"><span class="notetitle">Note:</span> Please see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a> for
    details of how the elements of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> are processed by
    a user agent.</p>
  <p>A <dfn id="valid-configuration-document-file-name">valid configuration document file name</dfn> is the string <code>config.xml</code>. </p>
  <p id="ta-dxzVDWpaWg">A <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> in an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a> that uses the
    
    file name <code>config.xml</code> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> file.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> Be sure to always include
    a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> and that the <code>config.xml</code> file name is in lowercase form. To ensure interoperability, encode the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>.</p>
  <h3 id="example-configuration-document"><span class="secno">7.1 </span>Example Configuration Document</h3>
  <p>The following is an example of a typical <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>:</p>
  <div class="example">
    <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;widget xmlns       = "http://www.w3.org/ns/widgets"
        id          = "http://example.org/exampleWidget"
        version     = "2.0 Beta"
        height      = "200"
        width       = "200"
        viewmodes   = "fullscreen"&gt;
 
  &lt;name short="Example 2.0"&gt;
    The example Widget!
  &lt;/name&gt;

  &lt;feature name="http://example.com/camera"&gt;
    &lt;param name="autofocus" value="true"/&gt;

  &lt;/feature&gt;

  &lt;preference name     = "apikey"
              value    = "ea31ad3a23fd2f"
              readonly = "true" /&gt;

  &lt;description&gt;
    A sample widget to demonstrate some of the possibilities.
  &lt;/description&gt;

  &lt;author href  = "http://foo-bar.example.org/"
          email = "foo-bar@example.org"&gt;Foo Bar Corp&lt;/author&gt;

  &lt;icon src="icons/example.png"/&gt;
  &lt;icon src="icons/boo.png"/&gt;
  &lt;content src="myWidget.html"/&gt;

  &lt;license&gt;
Example license (based on MIT License)
Copyright (c) 2008 The Foo Bar Corp.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
INSULT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  &lt;/license&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <p class="note"><span class="notetitle">Note:</span> Implementers are encouraged to
    expose relevant information provided by the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> to the
    user. Having "visual metadata" encourages authors to make full use of the configuration
    document format. See <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a> for instructions on how to process a
    configuration document.</p>
  <div class="authorguide">
    <p><strong>Authoring Guidelines:</strong> The only mandatory element in a configuration document  is the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. All other elements and their respective attributes are optional. The following example shows the smallest possible configuration document that a  user agent will be able to process. The reason to include this sole element is to explicitly inform a user agent or conformance checker that this zip file  attempts to conform to this specification. </p>
    <div class="example">
      <pre><code>

&lt;!-- example of the smallest possible conforming configuration document --&gt;
&lt;widget xmlns="http://www.w3.org/ns/widgets"/&gt;</code></pre>
    </div>
  </div>
  <h3 id="namespace"><span class="secno">7.2 </span>Namespace</h3>
  <p>The <dfn id="widget-namespace">widget namespace</dfn> URI for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> is <code>http://www.w3.org/ns/widgets</code> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xmlns">[XMLNS]</a>.</p>
  <p>No provision is made for an explicit version number in this specification. If a future version of this specification requires explicit versioning of the document format, a different namespace will be used.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> Be sure to declare
    the widget namespace as part of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. If the namespace is absent, then the widget will be treated by the user agent as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <h3 id="proprietary-extensions"><span class="secno">7.3 </span>Proprietary Extensions</h3>
  <p><em>This section is non-normative</em>.</p>
  <p> Implementers or authors intending to extend the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> format with
    their own <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> elements and attributes (or those defined in other
    specifications) can do so by using a separate <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xmlns">[XMLNS]</a> namespace. This specification does not define a model for processing <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> elements outside the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-namespace">widget namespace</a> (they are simply <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore" title="ignore">ignored</a> during processing).</p>
  <div class="example">
    <p>Example of extending the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> format:</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"
   <strong>xmlns:ex="http://example.org/"</strong>&gt;
       &lt;icon src="idle.png" <strong> ex:role="inactive"/&gt;

       </strong>&lt;icon src="big.png" <strong>ex:role="big"</strong>/&gt;
       <strong>&lt;ex:datasource&gt;{'a':'b','c':'d'}&lt;/ex:datasource&gt;</strong>

       &lt;content src="widget.html"/&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="types-of-attributes"><span class="secno">7.4 </span>Types of Attributes</h3>
  <p>This section defines the different <dfn id="attribute-types">attribute types</dfn> used in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> and what constitutes valid values for those
    attribute types. </p>
  <p>An attribute is <dfn id="invalid">invalid</dfn> if its value does not conform to its said <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#attribute-types" title="attribute types">attribute type</a>; that is, if the value of the
    attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> given the processing rules for that type of
    attribute. </p>
  <dl>
    <dt><dfn id="boolean-attribute">Boolean attribute</dfn></dt>
    <dd>
      <p>A boolean attribute is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute">keyword attribute</a> that can only be used
        with a valid boolean value. A <dfn id="valid-boolean-value">valid boolean value</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword">keyword</a> that
        case-sensitively matches <code>true</code> or <code>false</code>. Unless specified
        otherwise, the default behavior, which is used when the attribute is omitted or has
        a value other than the two allowed values, is <code>false</code>. The way a user
        agent interprets a boolean attribute is defined as part of an attribute's
        definition (see, for example, the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element's <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute). </p>
    </dd>
    <dt><dfn id="string-attribute">String attribute</dfn></dt>
    <dd>
      <p>The value of a string attribute is any string that conforms to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> as a valid string for an XML attribute. The purpose of this attribute type is to classify strings that are not affected by the <code title="dir"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute, such as the <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute (i.e., these attributes will not treated as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute" title="Displayable-string attribute">displayable-strings</a> during <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>). </p>
    </dd>
    <dt><dfn id="displayable-string-attribute">Displayable-string attribute</dfn></dt>
    <dd>
      <p>An attribute whose primary purpose is to convey human readable information, such as the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element's <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute and the widget element's <code title="widget version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-version">version</a></code> attribute. </p>
    </dd>
    <dt><dfn id="keyword-attribute">Keyword attribute</dfn></dt>
    <dd>
      <p>A <dfn id="keyword">keyword</dfn> is a string that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> for the purpose
        of this specification. The value of a keyword attribute is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword">keyword</a> that is one of a finite set specified in the attribute's definition in the case
        given in this specification. </p>
    </dd>
    <dt><dfn id="keyword-list-attribute">Keyword list attribute</dfn></dt>
    <dd>
      <p>An attribute defined as taking one or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword" title="keyword">keywords</a> as a value, which are separated by <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a>. </p>
    </dd>
    <dt><dfn id="media-type-attribute">Media type attribute</dfn></dt>
    <dd>
      <p>An attribute whose value is defined as containing a valid media type. A <dfn id="valid-media-type">valid media type</dfn> is string that matches the production for <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-mime-type">valid-MIME-type</a></code> in the following <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#abnf">[ABNF]</a>:</p>
      <pre><code><dfn id="valid-mime-type">valid-MIME-type</dfn> = type "/" subtype *(";" parameter)</code></pre>
      <p>The <dfn class="external" id="mime-type-part" title="mime type-part"><code>type</code></dfn>, <dfn class="external" id="mime-subtype-part" title="mime subtype-part"><code>subtype</code></dfn>, and <dfn class="external" id="mime-parameter" title="mime parameter"><code>parameter</code></dfn> tokens are defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime">[MIME]</a> specification.</p>
    </dd>
    <dt><dfn id="language-attribute">Language attribute</dfn></dt>
    <dd>
      <p>An attribute whose value is defined as containing a <dfn id="valid-language-tag">valid language tag</dfn> (see the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
        Registry</a> for an authoritative list of possible values, see also the <a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements">Maintenance Agency for ISO 3166 country codes</a>). A valid language tag is a string that conforms to the production of a <code>Language-Tag</code>, as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a> specification.</p>
    </dd>
    <dt><dfn id="numeric-attribute">Numeric attribute</dfn></dt>
    <dd>
      <p>The value of a numeric attribute is a string containing a valid non-negative
        integer. A <dfn id="valid-non-negative-integer">valid non-negative integer</dfn> is a string that consists of one
        or more code points in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9).
        For example, the strings "002", "323", "23214", and so on. </p>
    </dd>
    <dt><dfn id="path-attribute">Path attribute</dfn></dt>
    <dd>
      <p>An attribute defined as containing a valid path. A <dfn id="valid-path">valid
        path</dfn> is one that matches the production of a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-rel-path">Zip-rel-path</a></code> or a <code>Zip-abs-path</code>. </p>
    </dd>
    <dd>
      <p class="authorguide"><strong>Authoring Guidelines:</strong> A valid path is not a URI: a valid path represents a
        hierarchical path to a file inside a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>, which exactly matches the value of a <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name
        field</a></var> of a <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#local-file-header">local file header</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a>.      This means that valid paths need not be URL encoded.</p>
    </dd>
    <dt><dfn id="iri-attribute">IRI attribute</dfn></dt>
    <dd>
      <p>An attribute defined as containing a valid IRI. A <dfn id="valid-iri">valid IRI</dfn> is one
        that matches the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri">IRI</a></code> token of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri">[IRI]</a> specification. </p>
    </dd>
    <dd>
      <p class=" authorguide"><strong>Authoring Guidelines:</strong> Because of the risk of confusion between IRIs that would be equivalent if dereferenced, the use of %-escaped characters in feature names is strongly discouraged. </p>
    </dd>
    <dt><dfn id="version-attribute">Version attribute</dfn></dt>
    <dd>
      <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute">displayable-string attribute</a> whose value is any arbitrary string value (possibly empty) within the constraints allowed for <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> attributes. This
        specification does not mandate any specific format, semantics, or special
        processing rule for the format of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#version-attribute">version attribute</a>. </p>
    </dd>
    <dd class="authorguide">
      <p><strong>Authoring Guidelines:</strong> For the purpose of this specification, the
        structure of version tags has no semantics; they are just treated as arbitrary
        strings (e.g. '1.0' is not less than '2.0', but is simply different). However,
        for the sake of consistency, one can choose to use the following <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#abnf">[ABNF]</a>:</p>
      <pre><code><dfn id="rec-version-tag">rec-version-tag</dfn> = 1*DIGIT "."  1*DIGIT [ "." 1*DIGIT]<br>                  *[ 1*ALPHA / SP / 1*DIGIT ]</code></pre>
      <dl class="example">
        <dt>Example version tags:</dt>
        <dd>
          <ul>
            <li><code>Version 1.0 Beta</code></li>
            <li><code>1.0 RC1</code></li>
            <li><code>1.0-Build/1580</code></li>
            <li><code>Joey the dog [5.1.2100]</code></li>
          </ul>
        </dd>
        <dt>Example of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rec-version-tag">rec-version-tag:</a></code></dt>
        <dd>
          <ul>
            <li><code>1.0</code></li>
            <li><code>1.10.1</code> <code>beta1</code></li>
            <li><code>1.02.12 RC1</code></li>
          </ul>
        </dd>
      </dl>
    </dd>
  </dl>
  <h3 id="global-attributes"><span class="secno">7.5 </span>Global Attributes</h3>
  <p>This section describes the behavior and expected usage of other relevant attributes
    that are part of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> specification and this specification. In this specification, these attributes are referred to as <dfn id="global-attributes-0">global attributes</dfn> because  they can be used on any element in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>. </p>
  <p>Although <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0">global attributes</a> can be used on any element in this specification, they sometimes have no effect on the element on which they are used. For example, applying <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute on an <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element will have no effect on the <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> elements or any of its attributes. What effect specifying a global attribute has on an elements is determined by <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a> of this specification.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> Although it is optional for an author to use any global attributes, their usage is recommended when appropriate (e.g., when  declaring the language will help with legibility and when directional information will assist the user agent render text correctly). </p>
  <h4 id="the-xml:lang-attribute"><span class="secno">7.5.1 </span>The <dfn><code>xml:lang</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute">language  attribute</a> that specifies, through a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-tag">language
    tag</a>, the language of the contents and attribute values of XML elements (see the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
    Registry</a>). The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> specification specifies the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute and its influence on  child nodes. </p>
  <div class="authorguide">
    <p><strong>Authoring Guidelines:</strong> Although <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a> recommends that language tags be casefolded in a particular way for presentation, case has no meaning in a language tag. As a reminder to authors that   user-agents map all language tags to lowercase, all examples in this document use lowercase. See also <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>, which also requires authors to use  language tags in lowercase form as the names of folders.</p>
    <p>Avoid subtags from the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
      Registry</a> marked as deprecated, grandfathered, or redundant. The intended
      purpose of the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute is to declare the primary language
      of an element, its attributes, and its descendant nodes; as such, it has no implication with regards to the directionality of the text in the user agent. To specify the directionality of text, see the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute. </p>
  </div>
  <h4 id="the-dir-attribute"><span class="secno">7.5.2 </span>The <dfn><code>dir</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute">keyword attribute</a> used  to specify   the directionality in which human-readable text is to be represented by a user agent (e.g., the text content of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element, the <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element, and the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element).   The directionality set by the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute applies to the text content and  any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute" title="displayable-string attribute">displayable string</a> attributes of  the element where it is used, and to  child elements in its content unless overridden with another instance of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> (i.e., in this specification, the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute only affects the <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element and to the <code title="widget version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-version">version</a></code> attribute of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element). </p>
  <p>The possible value of a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute is one of the <dfn id="valid-directional-indicators">valid directional  indicators</dfn>:</p>
  <dl>
    <dt><code><dfn id="ltr">ltr</dfn></code></dt>
    <dd>
      <p>Left-to-right text.  Request that the Unicode <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a> algorithm treat characters within an element  as embedded left-to-right.</p>
    </dd>
    <dt><code><dfn id="rtl">rtl</dfn></code></dt>
    <dd>
      <p>Right-to-left text.  Request that the Unicode <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a> algorithm treat characters within an element  as embedded right-to-left.</p>
    </dd>
    <dt><code><dfn id="lro">lro</dfn></code></dt>
    <dd>
      <p> Left-to-right override. Forces the Unicode <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a> algorithm to treat characters within an element as strong left-to-right characters.</p>
    </dd>
    <dt><code><dfn id="rlo">rlo</dfn></code></dt>
    <dd>
      <p>Right-to-left override. Forces the Unicode <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a> algorithm to treat characters within an element as strong right-to-left characters.</p>
    </dd>
  </dl>
  <p class="note"><span class="notetitle">Note:</span>For security reasons, implementations intending to display <abbr title="Internationalized Resource Identifiers">IRIs</abbr> and <abbr title="Internationalized domain name">IDNA</abbr> addresses found in the configuration document are strongly encouraged to follow the security advice given in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#refsUTR">[UTR36]</a>. This could include, for example,  behaving as if the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute had no effect on any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute" title="IRI attribute">IRI attributes</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute" title="path attribute">path attributes</a>, and the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element's <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute.</p>
  <p>The base direction of a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute is either set explicitly by the nearest parent element that uses the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute; or, in the absence of such an attribute, the base direction is inherited from the <dfn id="default-direction-of-the-document">default direction of the document</dfn>, which is left-to-right ("<code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ltr">ltr</a></code>"). </p>
  <h4 id="examples-of-usage"><span class="secno">7.5.3 </span>Examples of Usage</h4>
  <div class="example">
    <p>The following  example demonstrates the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute being  applied globally to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>. </p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets" dir="rtl" xml:lang="fa"&gt;
&lt;name short="آب و هوا"&gt;‎
آب و هوا برنامه&lt;/name&gt;
   &lt;description&gt; 
<span dir="rtl">این نرم افزار به شما اجازه می دهد تا برای دیدن آب و هوا در منطقه محلی تان.</span>
   &lt;/description&gt;
&lt;/widget&gt;</code></pre>
    <p>The following example shows the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute applied to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localized-content">localized content</a>. </p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;

   &lt;name short="Weather"&gt;
    Weather Application
   &lt;/name&gt;

   &lt;name short="<span dir="rtl">آب و هوا</span>" xml:lang="fa" dir="rtl"&gt; 
<span dir="rtl">    آب و هوا برنامه
   </span>&lt;/name&gt;

&lt;/widget&gt;</code></pre>
    <p>The following example shows the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute used with mixed language content: </p>
    <pre><code>
&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  &lt;name short="Weather"&gt;
   Weather! a totally awesome application!
  &lt;/name&gt;

  &lt;name short="آب و هوا" xml:lang="fa" dir="rtl"&gt;
  &lt;span dir="ltr" xml:lang="en"&gt;Weather!&lt;/span&gt; برنامه واقعا بزرگ
  &lt;/name&gt;

&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-widget-element-and-its-attributes"><span class="secno">7.6 </span>The <dfn title="widget element"><code>widget</code></dfn> Element and its Attributes</h3>
  <p>The <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element serves as a container for the
    other elements of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd> The <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element is the root element of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>. </dd>
    <dt>Occurrences:</dt>
    <dd> Exactly one, at the root element of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> document. </dd>
    <dt>Expected children (in any order):</dt>
    <dd><code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code>: zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one element is
      allowed per language</a>).</dd>
    <dd><code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code>: zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one
      element is allowed per language</a>).</dd>
    <dd><code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code>: zero or one.</dd>
    <dd><code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code>: zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one element is
      allowed per language</a>).</dd>
    <dd><code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code>: zero or more.</dd>
    <dd><code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code>: zero or one.</dd>
    <dd><code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code>: zero or more.</dd>
    <dd><code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code>: zero or more.</dd>
    <dt>Localizable via xml:lang:</dt>
    <dd> No. Inheritance of the value of this attribute by <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code>, <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code>, <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code>, and <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> will have no effect during processing in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>.</dd>
    <dt>Attributes:</dt>
    <dd> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="widget id"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-id-attribute">id</a></code>, <code title="widget version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-version">version</a></code>, <code title="widget height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-height">height</a></code>, <code title="widget width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-width">width</a></code>, <code title="widget viewmodes"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-viewmodes-attribute">viewmodes</a></code>. </dd>
  </dl>
  <h4 id="the-id-attribute"><span class="secno">7.6.1 </span>The <code><dfn title="widget id">id</dfn></code> Attribute</h4>
  <p>An <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute">IRI attribute</a> that denotes an identifier for the widget. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget id"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-id-attribute">id</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</p>
  <h4 id="the-version-attribute"><span class="secno">7.6.2 </span>The <code><dfn title="widget-element version">version</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#version-attribute">version attribute</a> that specifies the version of the widget. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget-element version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-version-attribute">version</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</p>
  <h4 id="the-height-attribute"><span class="secno">7.6.3 </span>The <code><dfn title="widget-element height">height</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-non-negative-integer" title="valid non-negative integer">numeric attribute</a> greater than <code>0</code> that indicates the preferred <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#viewport">viewport</a> height of the
    instantiated <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file-0">custom start file</a> in <a href="http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#length-units">CSS pixels</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget-element height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute">height</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</p>
  <h4 id="the-width-attribute"><span class="secno">7.6.4 </span>The <code><dfn title="widget-element width">width</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-non-negative-integer" title="valid non-negative integer">numeric attribute</a> greater than <code>0</code> that indicates the preferred <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#viewport">viewport</a> width of the
    instantiated <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file-0">custom start file</a> in <a href="http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#length-units">CSS pixels</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget-element width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute">width</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. </p>
  <h4 id="the-viewmodes-attribute"><span class="secno">7.6.5 </span>The <code><dfn title="widget viewmodes">viewmodes</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-list-attribute">keyword list attribute</a> that denotes  the author's
    preferred view mode, followed by the next most preferred view mode and so forth. When the attribute is missing, or is left empty, it implies that the author expects the user agent to select an appropriate viewmode for the widget.</p>
  <p>The concept of a <dfn class="external" id="viewport">viewport</dfn> is defined in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>, but is essentially a window or other viewing area on the screen (see section <a href="http://www.w3.org/TR/2008/REC-CSS2-20080411/visuren.html#q2">9.1.1 The viewport</a> of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>). The concept of a <dfn class="external" id="view-mode">view mode</dfn> is defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#view-modes">[View-Modes]</a> specification.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget viewmodes"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-viewmodes-attribute">viewmodes</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</p>
  <h4 id="the-defaultlocale-attribute"><span class="secno">7.6.6 </span>The <code title="widget defaultlocale"><dfn title="widget defaultlocale">defaultlocale</dfn></code> attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute">language  attribute</a> that specifies, through a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-tag">language
    tag</a>, the author's preferred locale for the widget. Its intended use is to provide a fallback in case the user agent cannot match any of the widget's <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localized-content">localized content</a> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list or in case the author has not provided any unlocalized content. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="widget id"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-id-attribute">defaultlocale</a></code> attribute with a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. </p>
  <h4 id="example-of-usage"><span class="secno">7.6.7 </span>Example of Usage</h4>
  <div class="example">
    <p>The following example shows how the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element can be used.</p>
    <pre><code><strong>&lt;widget xmlns     = "http://www.w3.org/ns/widgets"
    id        = "http://example.org/exampleWidget"
    version   = "2.0 Beta"
    height    = "200"
    width     = "200"
    viewmodes = "windowed floating"/</strong><strong title="">&gt;</strong></code></pre>
  </div>
  <h4 id="example-of-usage-of-the-defaultlocale-attribute"><span class="secno">7.6.8 </span>Example of Usage of the <code title="widget defaultlocale"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-defaultlocale-attribute">defaultlocale</a></code> attribute </h4>
  <div class="example">
    <p>The following example shows how the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element's <code title="widget defaultlocale"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-defaultlocale-attribute">defaultlocale</a></code> attribute can be used: </p>
    <pre>&lt;widget xmlns = "http://www.w3.org/ns/widgets"
        <strong>defaultlocale</strong> = "en-us"&gt;

<code>   &lt;name short="Weather" xml:lang="en-us"&gt;
    The Ultimate Weather Widget
   &lt;/name&gt;

   &lt;name short="Boletim" xml:lang="pt"&gt;
    Boletim Metereológico
   &lt;/name&gt;</code>

&lt;/widget&gt;</pre>
  </div>
  <h3 id="the-name-element-and-its-attributes"><span class="secno">7.7 </span>The <dfn title="name element"><code>name</code></dfn> Element and its Attributes</h3>
  <p>The <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element represents the full
    human-readable name for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget">widget</a> that is used, for example, in an
    application menu or in other contexts.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>In a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Any.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one element is allowed per language</a>).</dd>
    <dt>Expected children:</dt>
    <dd><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code>: zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>Yes.</dd>
    <dd>
      <p class="authorguide"><strong>Authoring Guidelines:</strong> The value of the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute needs to be unique for any subsequent element of this type.</p>
    </dd>
    <dt>Attributes:</dt>
    <dd> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code>.</dd>
  </dl>
  <h4 id="the-short-attribute"><span class="secno">7.7.1 </span>The <dfn title="name short"><code title="name short">short</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute">displayable-string attribute</a> intended to represent a condensed name for a widget (e.g., a name that could be used in context were only limited space is available, such as underneath an icon). </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute with an <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element.</p>
  <h4 id="example-of-usage-0"><span class="secno">7.7.2 </span>Example of Usage</h4>
  <div class="example">
    <p>The following example shows the usage of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;

   <strong>&lt;name short="Weather"&gt;
    The Ultimate Weather Widget
   &lt;/name&gt;

   &lt;name short="Boletim" xml:lang="pt"&gt;
    Boletim Metereológico
   &lt;/name&gt;</strong>

&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-description-element-and-its-attributes"><span class="secno">7.8 </span>The <dfn title="description element"><code>description</code></dfn> Element and its Attributes</h3>
  <p>The <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element represents a
    human-readable description of the widget.</p>
  <!-- metadata element -->
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>In a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Any.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one element is allowed per language</a>).</dd>
    <dt>Expected children:</dt>
    <dd><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code>: zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>Yes.</dd>
    <dd>
      <p class="authorguide"><strong>Authoring Guidelines:</strong> The value of the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute needs to be unique for any subsequent element of this type. If two or more elements with the same xml:lang attribute value are encountered, the user agent will <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> all but the matching first element. See <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a> for more details. </p>
    </dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>.</dd>
  </dl>
  <h4 id="example-of-usage-1"><span class="secno">7.8.1 </span>Example of Usage</h4>
  <div class="example">
    <p>An example usage of the description element.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  &lt;name&gt;Dahut Chaser&lt;/name&gt;
  <strong>&lt;description&gt;
Combining the latest weather info with your GPS position,
this widget alerts you of any significant dahut activity in your
area. When a big one walks by, the widget plots the best route on a map based
on the dahut's trajectory so you can chase it! With support for
built-in cameras, you can quickly upload all the Alpine action to
your blog or to the insane dahut chaser web site! Awesome!
  &lt;/description&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-author-element-and-its-attributes"><span class="secno">7.9 </span>The <dfn title="author element"><code title="">author</code></dfn> Element and its Attributes</h3>
  <p>An <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element represents people or an organization attributed with
    the creation of the widget.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Any.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or one.</dd>
    <dt>Expected children:</dt>
    <dd><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code>: zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No. Only the first instance of this element in <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a> will be used,
      regardless of the value of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> (if any).</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code>, <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code>.</dd>
  </dl>
  <h4 id="the-href-attribute"><span class="secno">7.9.1 </span>The <code><dfn title="author-element href">href</dfn></code> Attribute</h4>
  <p>An <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute">IRI attribute</a> whose value represents an IRI that the author
    associates with himself or herself (e.g., a homepage, a profile on a social network,
    etc.). </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute with an <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element.</p>
  <h4 id="the-email-attribute"><span class="secno">7.9.2 </span>The <code><dfn title="author email">email</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute">string attribute</a> that represents an email address associated with the author. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute with an <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element.</p>
  <h4 id="example-of-usage-2"><span class="secno">7.9.3 </span>Example of Usage</h4>
  <div class="example">
    <p>The following example shows the expected usage of the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
    &lt;name&gt;Café Finder&lt;/name&gt;
    <strong>&lt;author href  = "http://dahut.example.org/developers/"
            email = "cafefinder@example.org"&gt;
      Mr. Jo and Julia Bacalhau
    &lt;/author&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-license-element-and-its-attributes"><span class="secno">7.10 </span>The <dfn title="license element"><code>license</code></dfn> Element and its Attributes</h3>
  <p>The <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element represents a <dfn id="software-license">software
    license</dfn>, which includes, for example, a usage agreement, redistribution
    statement, and/or a copyright license terms under which the content of the widget
    package is provided.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Any.</dd>
    <dt>Expected children:</dt>
    <dd><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code>: zero or more.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#one-element-is-allowed-per-language">one element is allowed per language</a>).</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>Yes.</dd>
    <dd>
      <p class="authorguide"><strong>Authoring Guidelines:</strong> The value of the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute needs to be unique for any subsequent element of this type. The content of localized <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> elements shouldn't be used to present different versions of a license, just translations of the same license.</p>
    </dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code>. </dd>
  </dl>
  <h4 id="the-href-attribute-0"><span class="secno">7.10.1 </span>The <dfn title="license href"><code>href</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a> or a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a> that points to a
    representation of a software and/or content license. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute with a <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element.</p>
  <h4 id="example-of-usage-3"><span class="secno">7.10.2 </span>Example of Usage</h4>
  <div class="example">
    <p>This example shows the expected usage of the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element's <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  <strong>&lt;license href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"&gt;
Distributed under the W3C Software License.
  &lt;/license&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <div class="example">
    <p>This example shows the expected usage of the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element when the <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute is
      omitted.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  <strong>&lt;license&gt;
	... 
 </strong> <strong> 3.3.1 Widgets can use any APIs or libraries, prescribed by anyone.
   Widgets a are a free and open Web technology, so can be produced for free 
   and sold anywhere. Widgets can be written in JavaScript 
   so can run on any conforming engine (without the annoying restrictions of 
   C, C++, or Objective-C). You can even "cross-compile" them, if you want.  
	...  
  &lt;/license&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-icon-element-and-its-attributes"><span class="secno">7.11 </span>The <dfn title="icon element"><code>icon</code></dfn> Element and its Attributes</h3>
  <p>The <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element represents a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icon">custom
    icon</a> for the widget.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Empty.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No. Relies on <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>.</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code>, <code title="icon width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0">width</a></code>, <code title="icon height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0">height</a></code>. </dd>
  </dl>
  <h4 id="the-src-attribute"><span class="secno">7.11.1 </span>The <dfn title="icon src"><code>src</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute">path attribute</a> that points to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> inside the
    widget package. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> When an <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element is used, it is required for authors to
    use the <code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code> attribute.</p>
  <h4 id="the-width-attribute-0"><span class="secno">7.11.2 </span>The <code><dfn title="icon width">width</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-non-negative-integer" title="valid non-negative integer">numeric attribute</a> greater than <code>0</code> that represents,  in <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">CSS pixels</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>, the author's preferred width for the icon. A user agent <em class="ct">may</em> ignore this value when changing the height icon to fit a rendering context or for accessibility reasons. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="icon width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0">width</a></code> attribute of an <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element.</p>
  <h4 id="the-height-attribute-0"><span class="secno">7.11.3 </span>The <code><dfn title="icon height">height</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-non-negative-integer" title="valid non-negative integer">numeric attribute</a> greater than <code>0</code> that represents,  in <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">CSS pixels</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#css2">[CSS]</a>, the author's preferred height for the icon. A user agent <em class="ct">may</em> ignore this value when changing the height icon to fit a rendering context or for accessibility reasons. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="icon height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0">height</a></code> attribute of an <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element.</p>
  <h4 id="example-of-usage-4"><span class="secno">7.11.4 </span>Example of Usage</h4>
  <div class="example">
    <p>This example shows the expected usage of the <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element. The example declares three icon elements, two of
      which are raster and one of which is an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#svgtiny">[SVGTiny]</a> file. The raster
      graphics would be used for display contexts smaller than 256x256 pixels. <a href="http://www.w3.org/TR/xpath/#dt-document-order">Document order</a> of the elements is
      irrelevant.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  <strong>&lt;icon src="icons/medium.png"/&gt;
  &lt;icon src="icons/big.svg" width="256" height="256"/&gt;
  &lt;icon src="icons/tiny.png"/&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-content-element-and-its-attributes"><span class="secno">7.12 </span>The <dfn title="content element"><code>content</code></dfn> Element and its Attributes</h3>
  <p>The <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element is used by an author to
    declare which <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file-0">custom start file</a> the user agent is expected to use when it instantiates the widget.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Empty.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or one.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No. Relies on <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>.</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code>, <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code>, <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code>.</dd>
  </dl>
  <h4 id="the-src-attribute-0"><span class="secno">7.12.1 </span>The <code><dfn title="content src">src</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute">path attribute</a> that allows an author to point to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> within the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> When a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element is used, it is required for authors to
    use the <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute.</p>
  <h4 id="the-type-attribute"><span class="secno">7.12.2 </span>The <dfn title="content type"><code>type</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-attribute">media type attribute</a> that indicates the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> of
    the file referenced by the <code>src</code> attribute. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors
    to use the <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute with a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element. When the value is absent, the
    user agent will assume the value <code>text/html</code>. </p>
  <h4 id="the-encoding-attribute"><span class="secno">7.12.3 </span>The <dfn title="content encoding"><code>encoding</code></dfn> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute">keyword attribute</a> that denotes the character encoding of the file identified by
    the <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute. The  value is the "name"
    
    or "alias" of any "Character Set" listed in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iana-charsets">[IANA-Charsets]</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code> attribute with a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element. Where aliases are given by
    the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iana-charsets">[IANA-Charsets]</a> registry, authors are encouraged to use the value of the
    "preferred MIME name" (if any) from the registry.</p>
  <p>The <dfn id="default-encoding">default encoding</dfn> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>, which has the name "<code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">UTF-8</a></code>"  in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iana-charsets">[IANA-Charsets]</a> registry. </p>
  <p>Aside from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-encoding">default encoding</a>, it is <em class="ct">optional</em> for a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user
    agent</a> to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> other character encodings. </p>
  <h4 id="example-of-usage-5"><span class="secno">7.12.4 </span>Example of Usage</h4>
  <div class="example">
    <p>This example shows the expected usage of the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element:</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  <strong>&lt;content src="myWidget.html"/&gt;</strong>

&lt;/widget&gt;</code></pre>
  </div>
  <div class="example">
    <p>This example shows the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element being
      used with a <code>encoding</code> attribute to override the default value of the <code>encoding</code> attribute (<code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">UTF-8</a></code>) with the GB2312 character set, which the author has
      used to encode simplified Chinese characters:</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  &lt;name xml:lang="zh-cn"&gt;古老瓷地图&lt;/name&gt;
  &lt;name&gt;Ancient Chinese Maps&lt;/name&gt;
  <strong>&lt;content src="china-maps.html" encoding="GB2312"/&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <div class="example">
    <p>This example shows the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element being
      used with a <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute to instantiate a widget
      created with a proprietary <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a>:</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  &lt;name&gt;Location-Based Games Finder&lt;/name&gt;
  <strong>&lt;content src="lbg-maps.swf" type="application/x-shockwave-flash"/&gt;</strong>
  &lt;feature name="http://example.org/api.geolocation"
           required="false"/&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-feature-element-and-its-attributes"><span class="secno">7.13 </span>The <dfn title="feature element"><code>feature</code></dfn> Element and its Attributes</h3>
  <p>A <dfn id="feature">feature</dfn> is a URI identifiable runtime component (e.g. an Application Programming
    Interface or video decoder). The act of a an author requesting the availability of a feature through a <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element is referred to as a <dfn id="feature-request">feature request</dfn>. The <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element serves as a standardized means to request the
    binding of an IRI identifiable runtime component to a widget for use at runtime.
    Using a <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element denotes that, at runtime,
    a widget can attempt to access the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> identified by the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element's <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code> attribute. How a user agent makes use of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature" title="feature">features</a> depends
    on the user agent's security policy, hence activation and authorization requirements
    for features are beyond the scope of this specification. A feature has  zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter" title="parameter">parameters</a> associated with it.</p>
  <!--- p>When a <code title="feature element">feature</code> element is nested inside another feature element, it
  denotes a <dfn>fallback relationship</dfn>: if the feature identified by the outermost
  element is unavailable, then the user agent will check for the availability of the
  feature identified by the child's element's <code title="feature name">name</code> attribute.</p -->
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Zero or more <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> elements.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No.</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code>, <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code>. </dd>
  </dl>
  <h4 id="the-name-attribute"><span class="secno">7.13.1 </span>The <dfn title="feature name"><code title="feature name">name</code></dfn> Attribute</h4>
  <p>An <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute">IRI attribute</a> that identifies a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> that is needed by the widget at runtime (such as an <abbr title="application programming interface">API</abbr>). </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> When the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element is declared, it is required for authors to use the <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code> attribute.</p>
  <h4 id="the-required-attribute"><span class="secno">7.13.2 </span>The <code><dfn title="feature required">required</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#boolean-attribute">boolean attribute</a> that indicates whether or not this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> has to be available to the widget at runtime. </p>
  <p>When set to <code>true</code>, the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute denotes that a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> is absolutely needed by the widget to function correctly, and
    without the availability of this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> the widget serves no useful
    purpose or won't execute properly. </p>
  <p>When set to <code>false</code>, the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute denotes that a
    widget can function correctly without the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> being <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> or otherwise made available by the user agent. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute with an <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element. However, authors need to be aware that a user agent will behave as if the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute had been set to <code>true</code> when the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute is absent, meaning that the named <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> needs to be available  at
    runtime or the widget will be treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. </p>
  <h4 id="example-of-usage-6"><span class="secno">7.13.3 </span>Example of Usage</h4>
  <div class="example">
    <p>This example demonstrates a widget that would like to use a fictional geo-location <abbr title="application programming interface">API</abbr> feature, but would still
      be able to function if the feature cannot be made available to the widget by the user
      agent.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
   <strong>&lt;feature name     = "http://example.org/api/geolocation"
            required = "false"/&gt; </strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-param-element-and-its-attributes"><span class="secno">7.14 </span>The <dfn title="param element"><code>param</code></dfn> Element and its Attributes</h3>
  <p>The <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element defines a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter">parameter</a> for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>. A <dfn id="parameter">parameter</dfn> is a name-value pair that is <span class="associate">associated</span> with the corresponding <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a> for which the parameter is declared for. A author establishes the relationship between a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter">parameter</a> and feature  by having a <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element as a
    direct child of a <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element in <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a>.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element.</dd>
    <dt>Content model:</dt>
    <dd>Empty.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No.</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="param name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0">name</a></code>, <code title="param value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute">value</a></code>. </dd>
  </dl>
  <h4 id="the-name-attribute-0"><span class="secno">7.14.1 </span>The <code><dfn title="param name">name</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute">string attribute</a> that denotes the name of this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter">parameter</a>. </p>
  <p class="authorguide"><strong>Authoring Guideline:</strong>When a <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element is declared, it is required for authors to
    use the <code title="param name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0">name</a></code> attribute. </p>
  <h4 id="the-value-attribute"><span class="secno">7.14.2 </span>The <code><dfn title="param value">value</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute">string attribute</a> that denotes the value of this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter">parameter</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> When a <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element is used, it is required for authors to
    use the <code title="param value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute">value</a></code> attribute.</p>
  <h4 id="example-of-usage-7"><span class="secno">7.14.3 </span>Example of Usage</h4>
  <div class="example">
    <p>This example demonstrates a widget that makes use of a fictional geo-location
      feature where by its accuracy is set to "<code>low</code>" via a <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
   &lt;feature name="http://example.org/api/geolocation"&gt;
      <strong>&lt;param name="accuracy" value="low"/&gt; </strong>
   &lt;/feature&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-preference-element-and-its-attributes"><span class="secno">7.15 </span>The <code><dfn title="preference element">preference</dfn></code> Element and its Attributes</h3>
  <p>The <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element allows authors to
    declare one or more preferences: a <dfn id="preference">preference</dfn> is a persistently stored
    name-value pair that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate" title="associate">associated</a> with the widget the
    first time the widget is initiated.</p>
  <p class="note"><span class="notetitle">Note:</span> A user agent that <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-apis">[Widgets-APIs]</a> specification will expose any declared <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a> at runtime  in the manner described
    in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-apis">[Widgets-APIs]</a> specification.</p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element.</dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more.</dd>
    <dt>Expected children:</dt>
    <dd>none.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>No.</dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>, <code title="preference name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1">name</a></code>, <code title="preference value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0">value</a></code>, <code title="preference readonly"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-readonly-attribute">readonly</a></code>.</dd>
  </dl>
  <h4 id="the-name-attribute-1"><span class="secno">7.15.1 </span>The <code><dfn title="preference name">name</dfn></code> Attribute</h4>
  <p>A string that denotes the name of this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> When a <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element is used, it is required for authors to
    use the <code title="preference name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1">name</a></code> attribute.</p>
  <h4 id="the-value-attribute-0"><span class="secno">7.15.2 </span>The <code><dfn title="preference value">value</dfn></code> Attribute</h4>
  <p>A string that denotes the value of this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a>. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="preference value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0">value</a></code> attribute with a <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element.</p>
  <h4 id="the-readonly-attribute"><span class="secno">7.15.3 </span>The <code><dfn title="preference readonly">readonly</dfn></code> Attribute</h4>
  <p>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#boolean-attribute">boolean attribute</a> indicating whether this preference can, or cannot, be
    overwritten at runtime (e.g., via an author script). When set to <code>true</code>, it means that the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a> cannot be overwritten. When set to <code>false</code>, it means that the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a> can be overwritten. </p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> It is optional for authors to use the <code title="readonly">readonly</code> attribute with a <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element. If the <code title="readonly">readonly</code> attribute is absent, the user agent will act as if the readonly attribute had been set to <code>false</code> (meaning that the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a> can be overwritten at runtime).</p>
  <h4 id="example-of-usage-8"><span class="secno">7.15.4 </span>Example of Usage</h4>
  <div class="example">
    <p>This example shows a widget where two preferences are set. The second <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> is set as "read only" via the <code>readonly</code> attribute, which means the values of that preference cannot be changed at
      runtime.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
   <strong>&lt;preference name     = "skin"
               value    = "alien"/&gt;

   &lt;!-- The preference below will be protected
        from modification and deletion at runtime --&gt;

   &lt;preference name     = "api-key"
               value    = "f6d3a312f9d742"
               readonly = "true"/&gt;</strong>
&lt;/widget&gt;</code></pre>
  </div>
  <h3 id="the-span-element-and-its-attributes"><span class="secno">7.16 </span>The <dfn title="span element"><code>span</code></dfn> Element and its Attributes</h3>
  <p>The <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element is a wrapper for text content; on its own it serves no useful function. </p>
  <p>It is expected that authors will use the <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element  with the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0">global attributes</a>. When combined with the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute,  the <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element can indicate the textual directionality  of text content. In other words, it allows authors to set the base direction for the Unicode bidirectional algorithm <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a>. When combined with the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute, the <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element allows the author to indicate the particular language used for a subset of text content within  another element. </p>
  <dl>
    <dt>Context in which this element is used:</dt>
    <dd>As a child of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code>, <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code>, <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code>, and/or <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element. </dd>
    <dt>Occurrences:</dt>
    <dd>Zero or more.</dd>
    <dt>Expected children:</dt>
    <dd>Any.</dd>
    <dt>Localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>:</dt>
    <dd>
      <p>No, meaning that declaring <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> on a <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element within a parent element (e.g., a <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element) will not affect the behavior of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a> (see Example of Usage below to see how this works). </p>
    </dd>
    <dd>
      <p class="authorguide"><strong>Authoring Guidelines:</strong> Authors are encouraged to use <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> to indicate the language information for text content contained within a <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element. See Example of Usage for more information. </p>
    </dd>
    <dt>Attributes:</dt>
    <dd><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#global-attributes-0" title="global attributes">Global attributes</a>.</dd>
  </dl>
  <h4 id="example-of-usage-9"><span class="secno">7.16.1 </span>Example of Usage</h4>
  <p><em>This section is informative.</em></p>
  <div class="example">
    <p>This example shows the <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> elements being used to indicate directionality of text as well as language information. Note that the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element's <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute is set to an empty string to allow it to be used as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a> in the process of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a>: </p>
    <pre><code>&lt;widget
 xmlns="http://www.w3.org/ns/widgets"
 xml:lang="he" dir="rtl"&gt;
 &lt;name xml:lang="" dir="ltr"&gt;
  &lt;span xml:lang="en"&gt;GPS Weather!&lt;/span&gt;
 &lt;/name&gt;
 &lt;description&gt;
  יישומון ה-
  &lt;span dir="ltr" xml:lang="en"&gt;GPS Weather!&lt;/span&gt; מאפשר
 לך לבדוק את מזג הא
וויר בכל נקודת GPS ברחבי העולם.
 &lt;/description&gt;

&lt;description xml:lang="" dir="ltr"&gt;
   &lt;span xml:lang="en"&gt;The GPS Weather! widget lets you check
   the weather at any point around the world with GPS.&lt;/span&gt;
&lt;/description&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <h2 id="internationalization-and-localization"><span class="secno">8 </span>Internationalization and localization</h2>
  <p><dfn id="internationalization">Internationalization</dfn>, or i18n, is the design and development of a
    product, application or document content that enables  localization for target
    audiences that vary in culture, region, or language. <dfn id="localization">Localization</dfn> refers to
    the adaptation of a product, application or document content to meet the language,
    cultural and other requirements of a specific target market (a "locale").</p>
  <p class="note"><span class="notetitle">Note:</span> See also the <cite><a href="http://www.w3.org/TR/2004/NOTE-ws-i18n-scenarios-20040730/#locale">Web Services
    Internationalization Usage Scenarios</a></cite> and the <cite><a href="http://www.unicode.org/reports/tr35/#Locale">Unicode Locale Data Markup
    Language</a></cite> for an informative discussion on the term locale.</p>
  <p><dfn id="localized-content">Localized content</dfn> is content an author has explicitly <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localization" title="localization">localized</a>: that is, a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> that contains
    content localized using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a> or a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
    document</a> that contains content localized via <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based
    localization</a>.</p>
  <p><dfn id="default-content">Default content</dfn> is content included in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget
    package</a> or in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> that has not been
    explicitly localized or content explicitly indicated by the author to be used as default content via the <code>defaultlocale</code> attribute of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. In the case of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>, this means content outside the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">container for localized content</a>. In the case of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>,
    this means any element without an explicitly declared or inherited <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute.</p>
  <p>A <dfn id="localized-file">localized file</dfn> is any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> that has been placed inside a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a> (i.e., <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localized-content">localized content</a> that makes use of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>).  A widget
    package contains zero or more localized files. All files and
    folders, except for the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#digital-signature" title="digital signature">digital signatures</a> and
    the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>, can be localized via <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>.</p>
  <p class="example">For example, a locale folder "<code>locales/ja/</code>" (Japanese) might contain
    an HTML document translated into Japanese.</p>
  <p class="authorguide"><strong>Authoring Guidelines:</strong> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">Locale folders</a> need to be placed in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">container for
    localized content</a> (a locale folder not in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">container for localized
    content</a> will be treated as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> folder).  In addition, authors making use of localization features provided by this specification should  translate, localize, or alter <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localized-content">localized content</a> for a the given locale, and test their widgets thoroughly.</p>
  <h3 id="bidirectional-text"><span class="secno">8.1 </span>Bidirectional  text</h3>
  <p>In conjunction to mandating that user agents support <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a>, this specification provides the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute and <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element as a markup-based means of influencing the directionality for bidirectional Unicode text <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a>. See the  definitions of the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute and <code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code> element for usage examples. </p>
  <h3 id="localization-model"><span class="secno">8.2 </span>Localization Model</h3>
  <p>This specification provides two means that authors can use to explicitly localize
    the content of a widget:</p>
  <ol>
    <li>
      <p>By placing localized file content in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale
        folders</a>, a process referred to as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-based-localization-0">folder-based localization</a>.</p>
    </li>
    <li>
      <p>By explicitly marking XML elements in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> as
        localized, a process referred to as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a>.</p>
    </li>
  </ol>
  <p>Both forms of localization are described below. Folder-based and element-based
    localization rely on the user agent to match the language ranges held by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user
    agent locales</a></var> to the appropriate locale folders and/or localized XML elements in
    the widget's <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>.</p>
  <h3 id="folder-based-localization"><span class="secno">8.3 </span>Folder-based localization</h3>
  <p>This specification defines the concept of <dfn id="folder-based-localization-0">folder-based localization</dfn>,
    which is the process whereby an author places <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> inside <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder" title="folder">folders</a> that are named in a manner that conforms to a <code>language-range</code> ABNF rule of this specification. That
    is, by naming folders in lower-case using values derived from the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
    Registry</a> such as "<code>en-us</code>", "<code>en-gb</code>", and so on, but
    avoiding subtags marked as <dfn class="external" id="deprecated">deprecated</dfn>, <dfn class="external" id="grandfathered">grandfathered</dfn>, or <dfn class="external" id="redundant">redundant</dfn> in the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
    Registry</a>. These <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a> are then placed
    inside the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">container for localized content</a>.</p>
  <p class="authorguide"><strong>Authoring Guidelines</strong> Although BCP 47 recommends a particular case-folding convention, the use of upper or lowercase letters has no meaning in a language tag. Because folders inside a widget package are treated by the user-agent in a case-sensitive manner, the names of the folders inside a 'locale' folder must be all lowercase. All language tags are mapped to lowercase for matching purposes (although they can appear in any form in the configuration file or elsewhere).</p>
  <p>The <dfn id="container-for-localized-content">container for localized content</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#reserved">reserved</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a> at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> whose <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder-name">folder-name</a></code> case-sensitively matches the string '<code>locales</code>'. A
    container for localized content contains zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a>.</p>
  <p>A <dfn id="locale-folder-0">locale folder</dfn> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a> whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> matches the production of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder">locale-folder</a></code> and is a direct descendant of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#container-for-localized-content">container for localized content</a> (e.g., "<code>/locales/en-us</code>",
    "<code>/locales/fr</code>", etc). A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a> contains zero or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#arbitrary">arbitrary</a> folders and/or files.</p>
  <div class="authorguide">
    <p><strong>Authoring Guidelines</strong> Authors need to avoid region, script or
      other subtags except where they add useful distinguishing information to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a>. In addition, avoid including empty <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0" title="locale folder">locale folders</a> in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> (unless there
      is a good reason to include them).</p>
    <div class="example">
      <p>An example of a widget that uses folder-based localization:</p>
      <pre><code>widget.wgt
 locales/zh-hans-cn/a.gif
 locales/zh-hans-cn/f.gif
 locales/zh-hans/a.gif
 locales/zh-hans/b.gif
 locales/zh/a.gif
 locales/zh/b.gif
 locales/zh/c.gif
 a.gif
 b.gif
 c.gif
 d.gif
 index.html
 config.xml</code></pre>
    </div>
    <p>Authors can further facilitate the localization process by grouping <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> into <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a> hierarchies made up of matching subtags,
      as is shown in the example.</p>
    <p>Assuming the widget's locale is "zh-hans-cn", a reference to:</p>
    <ul>
      <li>a.gif would resolve to locales/zh-hans-cn/a.gif</li>
      <li> b.gif would resolve to locales/zh-hans/b.gif</li>
      <li> c.gif would resolve to locales/zh/c.gif</li>
      <li> d.gif would resolve to d.gif, as it is not associated with any
        locales and is hence available to all locales.</li>
    </ul>
    <p>This works at all sub-levels, so long as the parent subtag matches the child
      subtags. So, for example, the "<code>cn</code>" region can make use of the localized
      files in the "zh-hans" folder level, the "zh" folder level, and the unlocalized files
      at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a>. The user agent always prioritizes
      files in sub-folders over files in locale folders closer to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the
      widget package</a>. Conversely, if the widget's locale were "<code>en-us</code>",
      references to a.gif, b.gif, c.gif and d.gif would all resolve to the files in the
      root of the widget package.</p>
    <p>Note also that the user agent treats any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a> outside the container for localized content as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a>.</p>
  </div>
  <h3 id="element-based-localization"><span class="secno">8.4 </span>Element-Based Localization</h3>
  <p>This specification defines the concept of <dfn id="element-based-localization-0">element-based localization</dfn>,
    which allows authors to use the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute to explicitly indicate
    that an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> element in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> has been <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localization" title="localization">localized</a>.</p>
  <div class="example">
    <p>The following is an example of element-based localization:</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
   &lt;name short="Weather"&gt;
   The Ultimate Weather Widget
   &lt;/name&gt;

   &lt;name short="Boletim" xml:lang="pt"&gt;
    Boletim Metereológico
   &lt;/name&gt;
&lt;/widget&gt;</code></pre>
  </div>
  <p>Some of the elements in the widgets namespace are defined to be <dfn id="localizable-via-xml:lang">localizable via xml:lang</dfn> as part of the element's definition (with either "yes" or "no"). See, for example, the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element. When "yes", it means  that an author can utilize xml:lang to achieve <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-based-localization-0">element-based localization</a> either directly or indirectly through the inheritance of the value of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code>. How element-based localization is handled is specified in detail in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>. </p>
  <p class="note"><span class="notetitle">Note:</span> The xml:lang attribute can be used on any element in order to indicate which language is used in the content and attribute values of that element. As specified in the XML Specification, its value is inherited, such that if an element has an xml:lang attribute, all of its descendants are considered to be in that language as well, unless they specify their own <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute. Note that an element can indicate that it is in no specific language by setting <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> to the empty string, irrespective of whether any of its ancestors has an xml:lang attribute.</p>
  <div class="example">
    <p>For example, if an author uses the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute on the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element, then all child elements inherit
      the value xml:lang. This means that the first <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element below behaves as <code>xml:lang="en"</code> had been explicitly used.
      However, in the second <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element, the
      declaration of <code>xml:lang="pt"</code> overrides <code>xml:lang="en"</code> inherited from the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element. Finally, the last name element overrides xml:lang with an empty string, so that element will be treated by the user agent as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a>.</p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"
 xml:lang="en"&gt;

   &lt;name short="I'm in english, though not explicitly marked as such!"&gt;
    <strong>Behaves as if xml:lang="en"</strong>
   &lt;/name&gt;

   &lt;name xml:lang="pt"&gt;
    <strong>The declaration of xml:lang="pt" overrides
    xml:lang="en" inherited from the widget element. </strong>
   &lt;/name&gt;
   
   &lt;name xml:lang=""&gt;
    <strong>The user agent will treat this as unlocalized content.</strong> 
   &lt;/name&gt;

&lt;/widget&gt;</code></pre>
  </div>
  <p>If an element is marked as being localizable via <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> with "yes",
    the specification  indicates that only <dfn id="one-element-is-allowed-per-language">one element is allowed per language</dfn>:</p>
  <p>One element is allowed per language means that only one element of a type is
    allowed to be used per language (e.g., although many <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> elements can be present in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>, only one <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element will be selected by the user agent for the English language). During
    processing (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>), the user agent will only
    match the first element, in <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a>, that matches a
    language range in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> any
    subsequent repetitions of the element that contain a matching <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> value (even if that element's content is different).</p>
  <div class="example">
    <p>For example, assume the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> only contains the
      following language range: "<code>en-us</code>" (English as used in the United
      States). As only one instance of the <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element is allowed per language, in the
      following code the user agent would match the first <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element but would <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the
      second and third <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> elements.</p>
    <pre><code>
&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;

   &lt;description xml:lang="en"&gt;
      <strong>This element would be used.</strong>
   &lt;/description&gt;

   &lt;description xml:lang="en"&gt;
      <strong>This element would be ignored because there is already
      a description element that uses xml:lang="en".</strong>
   &lt;/description&gt;

   &lt;description&gt;
      <strong>This element is unlocalized, and would be used if the user agent's
      locale does not match any localized description elements.</strong>
   &lt;/description&gt;

	 &lt;description xml:lang=""&gt;
<strong>		This element would be ignored because there is already an unlocalized 
      description element! Using xml:lang="" makes this element behave as if
      it is unlocalized.</strong>
	 &lt;/description&gt;

&lt;/widget&gt;</code></pre>
    <p>However, if the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> only contained "<code>*</code>",
      or did not match any of the localized <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> elements, then the user agent would match
      the third <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element above.</p>
  </div>
  <p>In the case whereby the author does not use an <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute,
    and no element of a particular type with <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> matches the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var>, the user agent will use the
    first element that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a>, in <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a>, that matches the
    element type being sought.</p>
  <div class="example">
    <p>For example, now assume that the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> only contains the
      following language range: "<code>jp</code>" (Japanese). As only one instance of the <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element is allowed per
      language, in the following code the user will agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the first
      two <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> elements, but would match
      the third (unlocalized) <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element.</p>
    <pre><code>
&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;

   &lt;description xml:lang="en"&gt;
       <strong>This element would be ignored.</strong>
   &lt;/description&gt;

   &lt;description xml:lang="en"&gt;
      <strong>This element would be ignored.</strong>
   &lt;/description&gt;

   &lt;description&gt;
      <strong>In this case, this unlocalized element would be used.</strong>
   &lt;/description&gt;

&lt;/widget&gt;</code>
  </pre>
  </div>
  <h3 id="localization-examples"><span class="secno">8.5 </span>Localization Examples</h3>
  <p><em>This section is non-normative.</em></p>
  <p>This section presents three examples of how widgets can be localized. Each example
    is intended to showcase how the localization algorithm is intended to work.</p>
  <h4 id="simple-example"><span class="secno">8.5.1 </span>Simple Example</h4>
  <div class="example">
    <p class="no-toc no-num">This example shows a widget that displays the days of the
      week based on the language ranges held by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var>. If the
      user agent is unable to match a language range to any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a>, the
      widget displays <code>/index.html</code> at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget
      package</a>.</p>
    <div class="code_sniplet c1">
      <p><img alt="config: " height="16" src="./REC-widgets-20121127_files/config.png" width="16">config.xml</p>
      <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
&lt;name&gt;What day is it?&lt;/name&gt;
&lt;description&gt;
 This widget highlights the current day
 of the week.
&lt;/description&gt;
&lt;/widget&gt; </code></pre>
      <hr>
      <p><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16">locale/es/index.html</p>
      <pre><code>&lt;!doctype html&gt;
&lt;title&gt;¿Qué día es?&lt;/title&gt;
&lt;script src="scripts/dayfinder.js"&gt;&lt;/script&gt;
&lt;body&gt;
&lt;p&gt;Hoy es: lunes, martes, miércoles,
   jueves, viernes, sábado,
   domingo
</code></pre>
    </div>
    <ul class="dir_listing">
      <li class="widget_icon"> <img alt="widget file: " height="16" src="./REC-widgets-20121127_files/widget.png" width="16"> weekdays.wgt
        <ul>
          <li class="doc_icon"><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*English*/</span></li>
          <li class="doc_icon"><img alt="configuration document: " height="16" src="./REC-widgets-20121127_files/config.png" width="16"> config.xml</li>
          <li class="doc_icon"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> scripts
            <ul>
              <li><img alt="script: " height="16" src="./REC-widgets-20121127_files/script.png" width="16"> dayfinder.js</li>
            </ul>
          </li>
          <li class="config_icon"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> locales
            <ul>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> fr/
                <ul>
                  <li class="doc_icon"><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*French*/</span></li>
                </ul>
              </li>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> es/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*Spanish*/</span></li>
                </ul>
              </li>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> pt/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*Portuguese*/</span></li>
                </ul>
                <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> fi/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*Finnish*/</span></li>
                </ul>
              </li>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> it/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html <span class="comment">/*Italian*/</span></li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </div>
  <h4 id="complex-example"><span class="secno">8.5.2 </span>Complex Example</h4>
  <div class="example">
    <p>The following is an example of a localized widget with multiple localized <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icon" title="icon">icons</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file" title="start file">start files</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0" title="configuration document">configuration documents</a>. Some relevant
      things to note from the example:</p>
    <ul>
      <li>The Spanish version (<code>locales/es/</code>) has its own localized
        icon.</li>
      <li>The Spanish (<code>locales/es</code>) and English (<code>locales/en/</code>)
        versions of the widget use the un-localized script in <code>/scripts/engine.js</code> folder.</li>
      <li>On the other hand, the English-Australia (<code>en-au</code>) version uses a
        localized script (<code>en-au/scripts/engine.js</code>).</li>
    </ul>
    <div class="code_sniplet c1">
      <p><img alt="config: " height="16" src="./REC-widgets-20121127_files/config.png" width="16">/config.xml</p>
      <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
  &lt;name xml:lang="ko"&gt;웃기는 고양이&lt;/name&gt;
  &lt;content src="cats.html"/&gt;
&lt;/widget&gt; </code></pre>
      <hr>
      <p><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16">/locales/en-au/cats.html</p>
      <pre><code>&lt;!doctype html&gt;
&lt;title&gt;G'day! LOL Cats!&lt;/title&gt;
&lt;script src="scripts/engine.js"&gt;
...</code></pre>
      <hr>
      <p><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16">/locales/es/cats.html</p>
      <pre><code>&lt;!doctype html&gt;
&lt;title&gt;Gatos Graciosos!&lt;/title&gt;
&lt;script src="scripts/engine.js"&gt;
...</code></pre>
    </div>
    <ul class="dir_listing">
      <li class="widget_icon"> <img alt="widget file: " height="16" src="./REC-widgets-20121127_files/widget.png" width="16"> LOLcats.wgt
        <ul>
          <li class="doc_icon"><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> cats.html <span class="comment">/*written in Korean*/</span></li>
          <li class="config_icon"><img alt="configuration document: " height="16" src="./REC-widgets-20121127_files/config.png" width="16"> config.xml</li>
          <li class="doc_icon"><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> icon.png <span class="comment" title="">/*default icon*/</span></li>
          <li class="doc_icon"><img alt="Digital Signature: " height="16" src="./REC-widgets-20121127_files/signature.png" width="16"> signature.xml <span class="comment">/*not
            localizable*/</span></li>
          <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> scripts/
            <ul>
              <li><img alt="script: " height="16" src="./REC-widgets-20121127_files/script.png" width="16"> engine.js <span class="comment">/*default functionality*/</span></li>
            </ul>
          </li>
          <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> locales/ <span class="comment" title="">/*container for localized content*/</span>
            <ul>
              <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> en-au/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> cats.html</li>
                  <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> scripts/
                    <ul>
                      <li><img alt="script: " height="16" src="./REC-widgets-20121127_files/script.png" width="16"> engine.js <span class="comment">/*custom localized
                        functionality*/</span></li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> en/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> cats.html <span class="comment">/*international english
                    version*/</span></li>
                </ul>
              </li>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> es/
                <ul>
                  <li><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> cats.html <span class="comment">/*Spanish version*/</span></li>
                  <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> icon.png <span class="comment">/*localized icon*/</span></li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </div>
  <h4 id="fallback-behavior-example"><span class="secno">8.5.3 </span>Fallback Behavior Example</h4>
  <div class="example">
    <p>This specification allows authors to place files and folders they don't wish to
      localize at the root of the widget package. At runtime, if the user agent fails to
      find a file in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locale-folder-0">locale folder</a>, it will always search at the root of the
      widget package for that missing file. The purpose of this 'fallback' model is to
      reduce the number of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> that need to be created in order
      to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localization" title="localization">localize</a> a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</p>
    <p>The example below demonstrates how a user agent attempts to locate a file that is
      absent in a localized scenario. Assume the user agent's locale is '<code>en-gb</code>' and the zip relative path being sought is "<code>images/mast.png</code>":</p>
    <ol>
      <li>
        <p>Firstly, the user agent will search for a folder that matches the user agent's
          locale as closely as possible for the desired file. In this case, the user
          agent would attempt to locate the relative path <code>'images/mast.png</code>' in '<code>/locales/en-gb/</code>', but would fail. </p>
      </li>
      <li>
        <p>Secondly, if the file is absent, the user agent will search for the absent file in any
          other sub-folder that is in the language range of the current locale folder. So the next place the user agent would look is in the
          '<code>en/</code>' folder, where it would match the zip relative path '<code>images/mast.png</code>'.</p>
      </li>
      <li>
        <p>Lastly, if the above fails, the user agent will search for the absent file at the root
          of the widget package. So, if the user agent's locale did not find the zip relative path in one of the locale folders, then '<code>images/mast.png</code>' file at the root of the widget would be matched and this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a> would be used.</p>
      </li>
    </ol>
    <p>Now consider the for various Chinese variants: '<code>zh-hans-cn</code>',
      '<code>zh-hans</code>', and '<code>zh</code>' below. In this case, to find the
      '<code>flag.png</code>' file for Mainland Chinese in simplified script
      '<code>zh-hans-cn</code>', the user agent would first look in
      '<code>zh-hans-cn</code>', followed by '<code>zh-hans</code>', then in
      '<code>zh</code>' where the file is located.</p>
    <p>To find the '<code>mast.png</code>' file, the user agent would look in
      '<code>zh-hans-cn</code>', followed by '<code>zh-hans</code>', followed
      '<code>zh</code>', and finally at the root of the widget package where the absent
      file is actually located.</p>
    <div class="code_sniplet c1">
      <p><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16">/index.html</p>
      <pre><code>&lt;!doctype html&gt;
&lt;title&gt;Patriotic Boat&lt;/title&gt;
&lt;script src="scripts/engine.js"&gt;
&lt;/script&gt;
&lt;body&gt;
  &lt;img src="flag.png"&gt;
  &lt;img src="mast.png"&gt;</code></pre>
    </div>
    <ul class="dir_listing">
      <li class="widget_icon"> <img alt="widget file: " height="16" src="./REC-widgets-20121127_files/widget.png" width="16"> boat.wgt
        <ul>
          <li class="doc_icon"><img alt="file: " height="16" src="./REC-widgets-20121127_files/text.png" width="16"> index.html</li>
          <li class="doc_icon"><span class="config_icon"><img alt="configuration document: " height="16" src="./REC-widgets-20121127_files/config.png" width="16"> config.xml</span></li>
          <li class="config_icon"><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> flag.png</li>
          <li class="folder"><a class="folder" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"></a>images/
            <ul>
              <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> mast.png</li>
            </ul>
          </li>
          <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> scripts/
            <ul>
              <li><img alt="script: " height="16" src="./REC-widgets-20121127_files/script.png" width="16"> engine.js</li>
            </ul>
          </li>
          <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> locales/
            <ul>
              <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> en-gb/
                <ul>
                  <li class="folder"><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> images
                    <ul>
                      <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> flag.png</li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li class="folder"> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> en/
                <ul>
                  <li><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> images
                    <ul>
                      <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> mast.png</li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> zh-hans-cn/</li>
              <li><img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> zh-hans/</li>
              <li> <img alt="folder: " height="16" src="./REC-widgets-20121127_files/folder.png" width="16"> zh/
                <ul>
                  <li><img alt="icon: " height="16" src="./REC-widgets-20121127_files/image.png" width="16"> flag.png</li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </div>
  <h2 id="steps-for-processing-a-widget-package"><span class="secno">9 </span>Steps for Processing a Widget Package</h2>
  <p>The <dfn id="steps-for-processing-a-widget-package-0">steps for processing a widget package</dfn> involves nine steps that a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> follows in sequential order, responding
    accordingly if any of the steps result in an error or if the specification asks for the
    user agent to skip a step. The procedures for what to do when an error is encountered
    are described as part of each step; however, there are times when it will not be
    possible for the user agent to recover from an error and it will be forced to treat the
    widget as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <p>In the event that a user agent encounters an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a> during the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for processing a widget package</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> abort all processing of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for processing a
    widget package</a>.</p>
  <p class="note"><span class="notetitle">Note:</span>A user agent can optimize <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for processing a widget package</a> and associated <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processing-rules-0">processing rules</a> , or  perform the steps in a different order,
    but the end result needs to be indistinguishable from the result that
    would be obtained by following the specification.</p>
  <h3 id="processing-rules"><span class="secno">9.1 </span>Processing Rules</h3>
  <p>This section defines various <dfn id="processing-rules-0">processing rules</dfn>, which are algorithms used  during the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#steps-for-processing-a-widget-package-0">steps for processing a widget package</a>. </p>
  <p>These algorithm makes use of a few special concepts defined below:</p>
  <dl>
    <dt><dfn id="text-node">Text node</dfn></dt>
    <dd>
      <p>Any <code>Text</code> node, including <code>CDATASection</code> nodes (any <code>Node</code> with node type <code>TEXT_NODE</code> or <code>CDATA_SECTION_NODE</code>) as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#dom3core">[DOMCore]</a> specification. For example, the worlds "hello world!" in the following <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element: <code>&lt;name&gt;hello world!&lt;/name&gt;</code>.</p>
    </dd>
    <dt><dfn id="localizable-string">Localizable string</dfn> </dt>
    <dd>
      <p>A data structure containing a sequence of one or more strings, each having some
        associated directional information and language information (if any). The purpose of an localizable string is to assist user agent in
        correctly applying the Unicode <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bidi">[BIDI]</a> algorithm when displaying text. </p>
    </dd>
    <dd class="example">
      <p>For
        example, the string "Internationalization <span dir="rtl">نشاط التدويل!</span> Activity." The string contains both Arabic and English that mixes left-to-right text, right-to-left
        text, and a directionality-neutral punctuation mark that could not be correctly displayed 
        without directional information. </p>
    </dd>
    <dt><code><dfn id="null">null</dfn></code></dt>
    <dd>
      <p>A special symbol to indicate that a value has no data. For example, "let <var>x</var> be <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>" or "if <var>y</var> is empty, then return <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>".</p>
    </dd>
  </dl>
  <p class="note"><span class="notetitle">Note:</span> Note: Although languages such as ECMA Script and Java support <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> as a 
    native value type, there are some programming languages that have no 
    notion of <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> or where null is problematic (e.g. C++). Implementations 
    in these languages need to substitute a language-specific value or symbol 
    which is functionally equivalent to <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>, or if no equivalent exists, to 
    have no value at all. For example, the value 0 may represent <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> for 
    the height of a widget, since the height of a widget is defined as a 
    non-negative integer greater than 0. In such a case, 0 could be treated 
    as if it were <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>. </p>
  <h4 id="rule-for-verifying-a-zip-archive"><span class="secno">9.1.1 </span>Rule for Verifying a Zip Archive</h4>
  <p>The <dfn id="rule-for-verifying-a-zip-archive-0">rule for verifying a zip archive</dfn> is described in this
    section. The algorithm returns either true or an error.</p>
  <p>This specification does not provide the technical
    details of how to actually perform the checks, for which implementers need to refer to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification.</p>
  <ol>
    <li>
      <p>If the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> is <dfn class="external" id="split-into-multiple-files">split into multiple
        files</dfn> or spans <dfn class="external" id="multiple-volumes">multiple volumes</dfn>, as defined in
        the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification, then return an error and terminate this algorithm.</p>
    </li>
    <li>
      <p>If the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> is encrypted, as defined in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[Zip]</a>, return an error
        and terminate this algorithm.</p>
    </li>
    <li>Otherwise, return true. </li>
  </ol>
  <h4 id="rule-for-extracting-file-data-from-a-file-entry"><span class="secno">9.1.2 </span>Rule for Extracting File Data from a File Entry</h4>
  <p>The <dfn id="rule-for-extracting-file-data-from-a-file-entry-0">rule for extracting file data from a file entry</dfn> is as follows:</p>
  <ol>
    <li>
      <p>Let <var>path</var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">zip relative path</a> that identifies the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> being sought. </p>
    </li>
    <li>
      <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a></var> be the file entry identified by the <var>path</var>. </p>
    </li>
    <li>
      <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> be the result of decompressing (or extracting) the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-data">file data</a></var> from <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a></var> using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[Zip]</a>.</p>
    </li>
    <li>
      <p>Return <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var>.</p>
    </li>
  </ol>
  <p class="note"><span class="notetitle">Note:</span> For efficiency, a user agent can
    extract specific <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> as they are needed for processing
    rather than extracting all the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file" title="file">files</a> at once. As a security
    precaution, implementations are discouraged from extracting <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry" title="file entry">file entries</a> from un-trusted widgets directly onto the file system.
    Instead, implementations could use, for example, a virtual file system or mapping to
    access files inside a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</p>
  <h4 id="rule-for-finding-a-file-within-a-widget-package"><span class="secno">9.1.3 </span>Rule for Finding a File Within a Widget Package</h4>
  <p>The <dfn id="rule-for-finding-a-file-within-a-widget-package-0">rule for finding a file within a widget package</dfn> is given in the
    following algorithm. The algorithm returns either a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>, or an error. </p>
  <p>For
    the sake of comparison and matching, it is <em class="ct">recommended</em> that a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> treat all <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path" title="zip relative path">Zip relative paths</a> as <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>. </p>
  <p class="note"><span class="notetitle">Note:</span> This specification does not define
    how links in documents other than the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> are to be
    dereferenced. For handling links in other documents, such as (X)HTML, CSS, SVG, etc.,
    please refer to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-uri">[Widgets-URI]</a> specification.</p>
  <ol>
    <li>
      <p>Let <var>path</var> be the  path to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file
        entry</a> being sought by the user agent.</p>
    </li>
    <li>
      <p>If <var>path</var> is not a valid path, return an error and terminate this algorithm. </p>
    </li>
    <li>
      <p>If the <var>path</var> starts with a U+002F SOLIDUS (e.g.,
        "<code>/style/master.css</code>"),  then remove the first U+002F SOLIDUS from <var>path.</var></p>
    </li>
    <li>
      <p>Let <var>path-components</var> be the result of splitting <var>path</var> at
        each occurrence of a U+002F SOLIDUS character, removing that U+002F SOLIDUS
        character in the process.</p>
    </li>
    <li>
      <p> if the first item in <var>path-components</var> case-sensitively matches the string
        "<code>locales</code>", then:</p>
      <ol>
        <li>
          <p>If the <var>path-components</var> does not contain a second item, then return <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>.</p>
        </li>
        <li>
          <p>If the second item in <var>path-components</var> is not a valid <code>language-range</code>, then return <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> and terminate this
            algorithm.</p>
        </li>
        <li>
          <p>Otherwise, continue.</p>
        </li>
      </ol>
    </li>
    <li>
      <p>For each <var>lang-range</var> in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var>:</p>
      <ol>
        <li>
          <p>Let <var>path</var> be the concatenation of the string
            "<code>locales/</code>", the <var>lang-range</var>, a U+002F SOLIDUS character,
            and the <var>path</var> (e.g., <code>locales/en-us/cats.png</code>, where
            "<code>en-us</code>" is the <var>lang-range</var> and "<code>cats.png</code>"
            
            is the <var>path</var>).</p>
        </li>
        <li>
          <p>If <var>path</var> case-sensitively matches the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> within the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a></var> that is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a>,  then return an error and terminate this
            algorithm.</p>
        </li>
        <li>
          <p>If <var>path</var> case-sensitively matches the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> within the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a></var> that is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a>, let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> be the result of applying
            the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-extracting-file-data-from-a-file-entry-0">rule for extracting file data from a file entry</a> to <var>path</var>.</p>
        </li>
        <li>
          <p>If <var title="">file</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, then return <var title="">file</var> and terminate this algorithm.</p>
        </li>
        <li>
          <p>If the <var>path</var> points to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> that is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, then return an error and terminate this
            algorithm.</p>
        </li>
      </ol>
    </li>
    <li>
      <p>If every <var>lang-range</var> in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> have been
        searched, then search for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name
        field</a></var> matches <var>path</var> from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget
        package</a>:</p>
      <ol>
        <li>
          <p>If <var>path</var> points to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> within the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a></var> that is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder">folder</a>,  then return an error and terminate this
            algorithm.</p>
        </li>
        <li>
          <p>If <var>path</var> points to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> within the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a></var> that is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a>, let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> be the result of applying
            the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-extracting-file-data-from-a-file-entry-0">rule for extracting file data from a file entry</a> to <var>path</var>.</p>
        </li>
        <li>
          <p>If <var title="">file</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, then return <var title="">file</var> and terminate this algorithm.</p>
        </li>
        <li>
          <p>If the <var>path</var> points to a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a> that is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, then return an error and terminate this
            algorithm.</p>
        </li>
      </ol>
    </li>
    <li>
      <p>Otherwise, return <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>.</p>
    </li>
  </ol>
  <h4 id="rule-for-determining-directionality"><span class="secno">9.1.4 </span>Rule for Determining Directionality</h4>
  <p>The <dfn id="rule-for-determining-directionality-0">rule for determining directionality</dfn> is given in the following
    algorithm. The algorithm always returns one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-directional-indicators">valid directional indicators</a> as a string. </p>
  <ol>
    <li>
      <p>Let <var>element</var> be the element to be processed.</p>
    </li>
    <li>
      <p>If <var>element</var> is the root element of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>:</p>
      <ol>
        <li>
          <p>If  it does not contain a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute, return "<code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ltr">ltr</a></code>" and terminate this algorithm. </p>
        </li>
        <li>
          <p>If it does contain a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute, let <var>value</var> be value of the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></var> attribute of <var>element</var>. </p>
        </li>
        <li>
          <p>Remove any leading or trailing <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a> from <var>value</var>. </p>
        </li>
        <li>If <var>value</var> of the attribute  case-sensitively matches one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-directional-indicators">valid directional  indicators</a>, return the value of the attribute and terminate this algorithm. if the value does not case-sensitively match one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-directional-indicators">valid directional  indicators</a>, return  "<code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ltr">ltr</a></code>" and terminate this algorithm. </li>
      </ol>
    </li>
    <li>
      <p>If <var>element</var> does not contain a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute, recursively apply <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-directionality-0">rule for determining directionality</a> to the direct parent element of <var>element</var> and return the result. </p>
    </li>
    <li>
      <p>If <var>element</var> contains a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute, let <var>direction</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</a> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></var> attribute of <var>element</var>:</p>
      <ol>
        <li>
          <p> If <var>direction</var> case-sensitively matches one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-directional-indicators">valid directional  indicators</a>, return <var>direction</var> and terminate this algorithm. </p>
        </li>
        <li>
          <p>If <var>direction</var> did not case-sensitively match  one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-directional-indicators">valid directional  indicators</a>, apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-directionality-0">rule for determining directionality</a> to the direct parent element of <var>element</var> and return the result. </p>
        </li>
      </ol>
    </li>
  </ol>
  <h4 id="rule-for-getting-a-single-attribute-value"><span class="secno">9.1.5 </span>Rule for Getting a Single Attribute Value</h4>
  <p>The <dfn id="rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</dfn> is given in the following
    algorithm. The algorithm always returns either a string or a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">localizable string</a>, which can be empty. </p>
  <ol>
    <li>
      <p>Let <var>attribute</var> be the attribute to be processed.</p>
    </li>
    <li>
      <p>Let <var>value</var> be the value of the attribute to be processed.</p>
    </li>
    <li>
      <p>In <var>value</var>, replace any sequences of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a> (in
        any order) with a single U+0020 SPACE character.</p>
    </li>
    <li>
      <p>Remove any leading or trailing U+0020 SPACE characters from <var>value</var>.</p>
    </li>
    <li>
      <p>If the attribute is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute">displayable-string attribute</a>, then let <var>result</var> be a string that contains the value of <var>value</var>. </p>
    </li>
    <li>
      <p>Otherwise, if and only if the attribute is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute">displayable-string attribute</a>:</p>
      <ol>
        <li>
          <p>Let <var>result</var> be a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">localizable string</a> that contains the value of <var>value</var>.</p>
        </li>
        <li>
          <p>Let <var>element</var> be the element that owns <var>attribute</var>. </p>
        </li>
        <li>
          <p>Let <var>direction</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-directionality-0">rule for determining directionality</a> to <var>element</var>.</p>
        </li>
        <li>
          <p>Associate <var>direction</var> with <var>result</var>.</p>
        </li>
        <li>
          <p> Let <var>lang</var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-tag">language tag</a> derived from having processed the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute on either <var>element</var>, or in <var>element</var>'s  ancestor chain as per <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a>. If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></var> was not used anywhere in the ancestor chain, then let <var>lang</var> be an empty string. </p>
        </li>
        <li>
          <p>Associate <var>lang</var> with <var>result</var>.</p>
        </li>
      </ol>
    </li>
    <li>Return <var>result</var>. </li>
  </ol>
  <h4 id="rule-for-getting-a-list-of-keywords-from-an-attribute"><span class="secno">9.1.6 </span>Rule for Getting a List of Keywords From an Attribute</h4>
  <p>The <dfn id="rule-for-getting-a-list-of-keywords-from-an-attribute-0">rule for getting a list of keywords from an attribute</dfn> is given by the
    following algorithm. The algorithm takes a string as input, and returns a list of  strings  which can be empty.</p>
  <ol>
    <li>
      <p>Let <var>result</var> be the value of the attribute to be processed.</p>
    </li>
    <li>
      <p>In <var>result</var>, replace any sequences of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a> (in
        any order) with a single U+0020 SPACE character.</p>
    </li>
    <li>
      <p>In <var>result</var>, remove any leading or trailing U+0020 SPACE character.</p>
    </li>
    <li>
      <p>In <var>result</var>, split the string at each occurrence of a U+0020 character,
        removing that U+0020 character in the process.</p>
    </li>
    <li>Return <var>result.</var></li>
  </ol>
  <h4 id="rule-for-verifying-a-file-entry"><span class="secno">9.1.7 </span>Rule for Verifying a File Entry</h4>
  <p>The <dfn id="rule-for-verifying-a-file-entry-0">rule for verifying a file entry</dfn> is given in the following algorithm.
    The algorithm always returns a boolean value.</p>
  <p>For the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a>, check the following data in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#local-file-header">local file
    header</a></var>.</p>
  <ol>
    <li>
      <p>If the value of the <dfn id="crc-32">CRC-32</dfn> field (defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification) fails a CRC-32 check, return <code>false</code> and terminate this
        algorithm.</p>
    </li>
    <li>
      <p>The <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> is an empty string, return <code>false</code> and
        terminate this algorithm.</p>
    </li>
    <li>
      <p>The <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> contains <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-forbidden-characters">Zip forbidden characters</a>,
        return <code>false</code> and terminate this algorithm.</p>
    </li>
    <li>
      <p>The <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> is a sequence exclusively composed of (one or
        more) <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a> or a mixed sequence of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space
        characters</a> and U+002E FULL STOP (".") (e.g.
        " . .   "), return <code>false</code> and terminate this
        algorithm.</p>
    </li>
    <li>
      <p>The <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> is an invalid <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip relative
        path</a>, return <code>false</code> and terminate this algorithm.</p>
    </li>
    <li>return <code>true</code>.</li>
  </ol>
  <h4 id="rule-for-getting-text-content"><span class="secno">9.1.8 </span>Rule for Getting Text Content</h4>
  <p>The <dfn id="rule-for-getting-text-content-0">rule for getting text content</dfn> is given in the following algorithm.
    The algorithm always returns a list of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">localizable string</a>s, which can be empty.</p>
  <ol>
    <li>
      <p>Let <var>input</var> be the <code>Element</code> to be processed.</p>
    </li>
    <li>
      <p>Let <var>bidi-text</var> be an empty list of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string" title="localizable string">localizable strings</a>.</p>
    </li>
    <li>
      <p>If <var>input</var> has no child nodes, return an <var>bidi-text</var> and terminate this algorithm.</p>
    </li>
    <li>
      <p>Let <var>lang-strings</var> be an empty list (it will hold localizable strings). </p>
    </li>
    <li>
      <p>Let <var>lang</var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-tag">language tag</a> derived from having processed the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute on either <var>input</var>, or in <var>input</var>'s  ancestor chain as per <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a>. If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></var> was not used anywhere in the ancestor chain, then let <var>lang</var> be an empty string.</p>
    </li>
    <li>
      <p>Let <var>direction</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-directionality-0">rule for determining directionality</a> to <var>input</var>. </p>
    </li>
    <li>
      <p>Associate <var>lang</var> and <var>direction</var> with <var>bidi-text</var>. </p>
    </li>
    <li>
      <p>For each <var>child node</var> of <var>input</var>: </p>
      <ol>
        <li>
          <p>If <var> child node</var> is not an <code>Element</code> or <code>TextNode</code>, move onto the next child element and ignore the following sub-steps. </p>
        </li>
        <li>
          <p>If the <var> child node</var> is an <code>Element</code>, let <var>lstring</var> be the result of recursively applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-0">rule for getting text content</a> using this <var>current child element</var> as the argument. </p>
        </li>
        <li>
          <p>If the <var> child node</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node" title="text node">text node</a>, then: </p>
          <ol>
            <li>
              <p> Create a new localizable string called <var>lstring</var>, using the text content of the <var>current child node</var> as the text value, <var>direction</var> as the direction, and <var>lang</var> as the language. </p>
            </li>
          </ol>
        </li>
        <li> Append <var>lstring</var> to the <var>lang-string</var> list. </li>
      </ol>
    </li>
    <li>
      <p>Take all the text nodes, in order, from the returned <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">localizable string</a> and associate them with <var>bidi-text</var>. </p>
    </li>
    <li>return <var>bidi-text</var>.</li>
  </ol>
  <div class="example">
    <p>For example, the following configuration document: </p>
    <pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;widget xmlns="http://www.w3.org/ns/widgets" dir="rtl" xml:lang="fr"&gt;
&lt;name dir="rlo"&gt;
   &lt;span xml:lang="jp"&gt;Hello &lt;span dir="rtl"&gt;&lt;span dir="rlo"/&gt;backwards&lt;/span&gt;&lt;/span&gt;
&lt;/name&gt;
&lt;/widget&gt;</pre>
    <p>When the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-0">rule for getting text content</a> is applied could be logically represented as pseudo code: </p>
    <pre><code>
{dir: rlo,
 lang: fr,
 textNodes:
	[{data: "Hello ",
     direction: "rlo",
     lang: "jp"},
              
     {data: "backwards",
      direction: "rtl",
      lang: "jp"}]
}</code></pre>
  </div>
  <h4 id="rule-for-getting-text-content-with-normalized-white-space"><span class="secno">9.1.9 </span>Rule for Getting Text Content with Normalized White Space</h4>
  <p class="no-toc no-num">The <dfn id="rule-for-getting-text-content-with-normalized-white-space-0">rule for getting text content with normalized white
    space</dfn> is given in the following algorithm. The algorithm always returns a string,
    which can be empty.</p>
  <ol>
    <li>
      <p>Let <var>input</var> be the <code>Element</code> to be processed.</p>
    </li>
    <li>
      <p>Let <var>result</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-0">rule for getting text
        content</a> to <var>input</var>.</p>
    </li>
    <li>
      <p>In <var>result</var>, convert any sequence of one or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a> into a single U+0020 SPACE.</p>
    </li>
    <li>
      <p>In <var>result</var>, remove any leading or trailing U+0020 SPACE character.</p>
    </li>
    <li>
      <p>Return <var>result</var>.</p>
    </li>
  </ol>
  <div class="example">
    <p>For example, the user agent would <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> and <code>blink</code> elements, but their <code>Text</code> nodes would be extracted (together with directional and language information): </p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"
 		 xmlns:x="http://x.x.example/x" xml:lang="en"&gt;
   &lt;name&gt;
     The &lt;blink xml:lang="en-us"&gt;Awesome&lt;/blink&gt;
     &lt;author email="dude@example.com"&gt;Super &lt;x:blink dir="rtl"&gt;Dude&lt;/x:blink&gt;&lt;/author&gt;
     Widget&lt;/name&gt;
&lt;/widget&gt;</code></pre>
    <p>The resulting <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-name">widget name</a></var> would be "<samp>The Awesome Super
      <bdo dir="rtl">Dude</bdo>
      Widget</samp>" (please note that <q>Dude</q> is rendered right-to-left).</p>
  </div>
  <h4 id="rule-for-parsing-a-non-negative-integer"><span class="secno">9.1.10 </span>Rule for Parsing a Non-negative Integer</h4>
  <p>The <dfn id="rule-for-parsing-a-non-negative-integer-0">rule for parsing a non-negative integer</dfn> is given in the following
    algorithm.  This algorithm  returns the number zero, a positive integer, or an error.</p>
  <ol>
    <li>
      <p>Let <var title="">input</var> be the string being parsed.</p>
    </li>
    <li>
      <p>Let <var title="">result</var> have the value <code>0</code>.</p>
    </li>
    <li>
      <p>If the length of <var title="">input</var> is <code>0</code>, return an
        error.</p>
    </li>
    <li>
      <p>Let <var title="">position</var> be a pointer into <var title="">input</var>,
        initially pointing at first character of the string.</p>
    </li>
    <li>
      <p>Let <var>nextchar</var> be the character in <var>input</var> at <var>position</var>.</p>
    </li>
    <li>
      <p>If the <var>nextchar</var> is one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a>,
        increment <var title="">position</var>. If <var>position</var> is past the end of <var>input</var>, return an error and terminate this algorithm. Otherwise, go to step 5 in this algorithm.</p>
    </li>
    <li>
      <p>If the <var>nextchar</var> is not one of U+0030 (<code>0</code>) .. U+0039
        (<code>9</code>), then return <var>result</var>.</p>
    </li>
    <!-- Ok. At this point we know we have a number. It might have
                           trailing garbage which we'll ignore, but it's a number, and we
                           won't return an error. -->
    <li>
      <p>If the <var>nextchar</var> is one of U+0030 (<code>0</code>) .. U+0039
        (<code>9</code>):</p>
      <ol style="list-style-type:upper-alpha">
        <li>
          <p>Multiply <var title="">result</var> by ten.</p>
        </li>
        <li>
          <p>Add the value of the <var>nextchar</var> to <var title="">result</var>.</p>
        </li>
        <li>
          <p>Increment <var title="">position</var>.</p>
        </li>
        <li>
          <p>If <var title="">position</var> is not past the end of <var title="">input</var>, go to 5 in this algorithm.</p>
        </li>
      </ol>
    </li>
    <li>
      <p>Return <var title="">result</var>.</p>
    </li>
  </ol>
  <h4 id="rule-for-identifying-the-media-type-of-a-file"><span class="secno">9.1.11 </span>Rule for Identifying the Media Type of a File</h4>
  <p>The <dfn id="rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a file</dfn> is given by the
    following algorithm. The algorithm always returns a
    string.</p>
  <p class="note"><span class="notetitle">Note:</span>This rule is only to be applied
    when explicitly instructed to by the specification (e.g., during <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>). There
    are situations where alternative means are defined by the specification to identify the
    media type of a file (e.g., by the presence of the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute or deriving the media type of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-file">default start file</a> from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a>).</p>
  <ol>
    <li>
      <p>Let <var title="">file</var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> to be processed. </p>
    </li>
    <li>
      <p>Let <var>content-type</var> be an empty string.</p>
    </li>
    <li>
      <p>Let <var>extension</var> be an empty string.</p>
    </li>
    <li>
      <p>Let <var>name</var> be the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name">file-name</a></code> component of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">zip relative path</a> that identifies the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var>.</p>
      <p class="example">For example, the <var>name</var> for "<code>some/zip/rel/path/hello.png</code>" would be "<code>hello.png</code>". </p>
    </li>
    <li>
      <p>If the first character of the <var>name</var> is  a   U+002E 'FULL STOP'  character, and the file name contains no other U+002E 'FULL STOP'  character, then go to step 10 of this algorithm. </p>
      <p class="example">For example, if the name is "<samp>.htaccess</samp>", jump to step 10 and derive the media type using   the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sniff">[SNIFF]</a> specification. </p>
    </li>
    <li>
      <p>If the first character or last character of the <var>name</var> is  not a   U+002E 'FULL STOP'  character, but <var>name</var> contains one or more U+002E 'FULL STOP'  characters, then let <var>extension</var> be the sequence of characters from the last U+002E 'FULL STOP' (inclusive) to the end of <var>name</var>. </p>
      <p class="example">The value of <var>extension</var> for the file name "<samp>cat.html</samp>" would be ".<samp><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">html</a></samp>". The value of extension for "...html" would be ".html". And the value of <var>extension</var> for "hello." would be an empty string. </p>
    </li>
    <li>
      <p>If the first character of the <var>name</var> is  a   U+002E 'FULL STOP'  character, and the file name contains another U+002E 'FULL STOP'  character, then let <var>extension</var> be the sequence of characters from the last U+002E 'FULL STOP' (inclusive) to the end of <var>name</var> (if any). </p>
      <p class="example">For example, if the <var>name</var> is "<samp>.myhidden.html</samp>", then the extension would be "<samp><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">.html</a></samp>".</p>
    </li>
    <li>
      <p>If <var>extension</var> is an empty string, go to step 10 in this algorithm.</p>
    </li>
    <li>
      <p>Check that  each  character in the <var> extension</var> is either in the  U+0041-U+005A range or in the  U+0061-U+007A range (ASCII uppercase and lowercase characters, respectively) or in the U+0030-U+0039 range (ASCII numbers 0 to 9): </p>
      <ol>
        <li>
          <p>If any  character in the <var>extension</var> is outside  the    U+0041-U+005A range or  the  U+0061-U+007A range or the U+0030-U+0039 range, then go to step 10 in this algorithm. </p>
          <p class="example">For example, if the extension is "<samp>.pñg</samp>", the go to step 10 in this algorithm. </p>
        </li>
        <li>
          <p> If all characters in the <var>extension</var> are in any of the  U+0041-U+005A range or in the  U+0061-U+007A range  or the U+0030-U+0039 range (e.g., "<code>Mp3</code>"), then attempt to case-insensitive match
            the value of <var>extension</var> to one of the values in the file extension column in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-identification-table">file identification table</a>. If there is a match, then return let <var>content-type</var> be the corresponding value from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> column. </p>
        </li>
        <li>
          <p>Go to step 11.</p>
        </li>
      </ol>
    </li>
    <li>
      <p> Let <var>content-type</var> be the result of processing <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> through the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sniff">[SNIFF]</a> specification. </p>
    </li>
    <li>Return the value of <var>content-type</var>.</li>
  </ol>
  <table>
    <caption>
    <dfn id="file-identification-table">File Identification Table</dfn>
    </caption>
    <thead>
      <tr>
        <th scope="col">file extension</th>
        <th scope="col">media type</th>
      </tr>
    </thead>
    <tbody><tr>
      <td>.html</td>
      <td>text/html</td>
    </tr>
    <tr>
      <td>.htm</td>
      <td>text/html</td>
    </tr>
    <tr>
      <td>.css</td>
      <td>text/css</td>
    </tr>
    <tr>
      <td>.js</td>
      <td>application/javascript</td>
    </tr>
    <tr>
      <td>.xml</td>
      <td>application/xml</td>
    </tr>
    <tr>
      <td>.txt</td>
      <td>text/plain</td>
    </tr>
    <tr>
      <td>.wav</td>
      <td>audio/x-wav</td>
    </tr>
    <tr>
      <td>.xhtml</td>
      <td>application/xhtml+xml</td>
    </tr>
    <tr>
      <td>.xht</td>
      <td>application/xhtml+xml</td>
    </tr>
    <tr>
      <td>.gif</td>
      <td>image/gif</td>
    </tr>
    <tr>
      <td>.png</td>
      <td>image/png</td>
    </tr>
    <tr>
      <td>.ico</td>
      <td>image/vnd.microsoft.icon</td>
    </tr>
    <tr>
      <td>.svg</td>
      <td>image/svg+xml</td>
    </tr>
    <tr>
      <td>.jpg</td>
      <td>image/jpeg</td>
    </tr>
    <tr>
      <td>.mp3</td>
      <td>audio/mpeg</td>
    </tr>
  </tbody></table>
  <p>It is <em class="ct">optional</em> for a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0" title="media type">media types</a> given in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-identification-table">file identification table</a>. </p>
  <h4 id="rule-for-deriving-the-user-agent-locales"><span class="secno">9.1.12 </span>Rule for Deriving the <var title="">user agent locales</var></h4>
  <p>The <dfn id="rule-for-deriving-the-user-agent-locales-0">rule for deriving the <var>user agent locales</var></dfn> is as follows: </p>
  <ol>
    <li>
      <p>Let <var>unprocessed locales list</var> be a list that  contains the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#system">end-user's language ranges</a>.</p>
    </li>
    <li>
      <p>For each <var>range</var> in the <var>unprocessed locales list</var>: </p>
      <ol>
        <li>
          <p>If this <var>range</var> begins with the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtag</a> '<code>*</code>' (e.g. "<code>*-us</code>" or just "<code>*</code>"),  or contains any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#space-characters">space characters</a>, skip
            all the steps in this algorithm below, and move onto the next <var>range</var>.</p>
        </li>
        <li>
          <p>If this <var>range</var> begins with the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtag</a> "<code>i</code>" or the <var>range</var> is marked as "deprecated" in the <a href="http://www.iana.org/assignments/language-subtag-registry">IANA Language Subtag
            Registry</a>, or is or is null, skip
            all the steps in this algorithm below, and move onto the next <var>range</var>. </p>
        </li>
        <li>
          <p>If this <var>range</var> contains any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtag</a> '<code>*</code>', remove the '<code>*</code>' and its preceding hyphen
            (<code>U+002D</code>) (e.g., '<code>en-*-us</code>' becomes
            '<code>en-us</code>').</p>
        </li>
        <li>
          <p>While <var>range</var> contains <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtags</a>:</p>
          <ol style="list-style:decimal">
            <li>
              <p>Add the value of the <var>range</var> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent
                locales</a></var>.</p>
            </li>
            <li>
              <p>Remove the right most <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtag</a> from <var>range</var> and append the resulting value to <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent
                locales</a></var>. Continue removing the right most <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags" title="subtags">subtag</a> and adding the result to <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent
                locales</a></var> until there are no <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#subtags">subtags</a> left in <var>range</var>.</p>
              <p class="example">For example, if the <var>range</var> was "<code>zh-hans-cn</code>",
                then the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> become
                "<code>zh-hans-cn,zh-hans,zh</code>".</p>
            </li>
            <li>
              <p> Move onto the next <var>range</var> and go to step 1 in this
                algorithm. </p>
            </li>
          </ol>
        </li>
      </ol>
    </li>
    <li>
      <p>Append the value "<code>*</code>" to the end of <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent
        locales</a></var>.</p>
    </li>
  </ol>
  <p class="example">For example, an <var>unprocessed locales list</var> that contains
    "<code>en-us,en-au,en,fr-ca,zh-hans-cn</code>" would result in a <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent
    locales</a></var> that contains
    "<code>en-us,en,en-au,en,en,fr-ca,fr,zh-hans-cn,zh-hans,zh,*</code>".</p>
  <p class="example">For example, an <var>unprocessed locales list</var> that contains
    "<code>en-us,en,fr-ca,en,en-ca</code>" would result in a <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> that contains "<code>en-us,en,en,fr-ca,fr,en,en-ca,en,*</code>". </p>
  <h4 id="rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive"><span class="secno">9.1.13 </span>Rule for Determining if a Potential Zip Archive is a Zip
    Archive</h4>
  <p>The <dfn id="rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining if a potential Zip archive is a Zip archive</dfn> is
    given by the following algorithm.</p>
  <ol>
    <li>
      <p>Let <var>potential archive</var> be the acquired resource.</p>
    </li>
    <li>
      <p>Check if the first four bytes of <var>potential archive</var> match the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#magic-numbers-for-a-zip-archive">magic numbers for a Zip archive</a> (<code>50 4B 03 04</code>). </p>
    </li>
    <li>
      <p>If the first four bytes do not match the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#magic-numbers-for-a-zip-archive">magic numbers for a Zip
        archive</a>, then return an error.</p>
    </li>
    <li>
      <p>Otherwise, return <code>true</code>.</p>
    </li>
  </ol>
  <p class="note"><span class="notetitle">Note:</span> A user agent can inspect the <var>potential archive</var> once it has acquired the first four bytes of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> or can wait until all the data of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> has been completely acquired.</p>
  <h3 class="no-num done" id="step-1-acquire-a-potential-zip-archive"><dfn>Step 1</dfn> - Acquire a Potential Zip Archive</h3>
  <p>Step 1 involves acquiring a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> and confirming that
    it is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining if a
    potential Zip archive is a Zip archive</a>. A user agent will acquire a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> from a data transfer protocol that either labels
    resources with a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> (e.g. <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#http">[HTTP]</a>) or from a data
    transfer protocol that does not label resources with a media type (e.g., BitTorrent
    or Bluetooth).</p>
  <h4 id="acquisition-of-a-potential-zip-archive-labeled-with-a-media-type"><span class="secno">9.1.1 </span><dfn>Acquisition of a Potential Zip archive Labeled with a Media Type</dfn></h4>
  <p id="ta-GVVIvsdEUo">It is <em class="ct">recommended</em> that a user agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acquisition-of-a-potential-zip-archive-labeled-with-a-media-type" title="acquisition of a potential Zip archive labeled with a media type">acquisition of a potential Zip archive from a protocol that labels resources with a media
    type</a> (e.g., getting a widget package over <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#http">[HTTP]</a>). If a user agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> acquisition of a potential Zip archive from a protocol that labels resources with a media
    type, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> needs to process resources labeled with the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-widget-media-type">valid widget
    media type</a> (<code>application/widget</code>), regardless of whether the
    resource contains a file extension or not, by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining
    if a potential Zip archive is a Zip archive</a>. During the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acquisition-of-a-potential-zip-archive-labeled-with-a-media-type">acquisition of a potential Zip archive labeled with a media
    type</a>, unless the user agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> legacy or
    proprietary <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0" title="media type">media types</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0" title="media type">media types</a> are in error and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <p id="ta-qxLSCRCHlN">If the result of  the user agent applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining
    if a potential Zip archive is a Zip archive</a> is <code>true</code>, meaning that the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> proceed
    to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive">Step 2</a>. Otherwise, if an error is returned, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. </p>
  <p class="example">For example, in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#http">[HTTP]</a>, where the <code>Content-Type</code> header matches <code>application/widget</code>.</p>
  <p>If the protocol used for acquisition of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> does
    not provide, or otherwise include, a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a>, then a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">should</em> treat the acquired <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> as if
    it has been <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#acquisition-of-potential-zip-archive-not-labeled-with-a-media-type" title="Acquisition of potential Zip archive not labeled with a media type">acquired from a protocol that does not label resources with a media
    type</a>.</p>
  <div class="example">
    <p>In this example, the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> of the <code>Content-Type</code> is
      not one <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent, so the user agent would treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>:</p>
    <dl>
      <dt>Request</dt>
      <dd>
        <pre><code>GET /foo.wgt HTTP/1.1
Host: www.example.com
Accept: application/widget</code></pre>
      </dd>
      <dt>Response</dt>
      <dd>
        <pre><code>HTTP/1.1 200 OK
Date: Tue, 04 Sep 2007 00:00:38 GMT
Last-Modified: Mon, 03 Sep 2007 06:47:19 GMT
Content-Length: 1337
Content-Type: application/x-gadget</code></pre>
      </dd>
    </dl>
  </div>
  <h4 id="acquisition-of-potential-zip-archive-not-labeled-with-a-media-type"><span class="secno">9.1.2 </span><dfn>Acquisition of Potential Zip Archive not Labeled with a Media
    Type</dfn></h4>
  <p id="ta-FDGQBROtzW">When acquiring a potential Zip archive that has not been labeled with a media type (e.g., from a file system), a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">should</em> attempt to process
    the resource regardless of the file extension (including situations when the file
    extension is absent) by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining if a potential Zip
    archive is a Zip archive</a>. If the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-determining-if-a-potential-zip-archive-is-a-zip-archive-0">rule for determining if a potential Zip
    archive is a Zip archive</a> return <code>true</code>, proceed to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-2-verify-the-zip-archive">Step
    2</a>. Otherwise, if an error was returned, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#potential-zip-archive">potential Zip archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <h3 class="no-num done" id="step-2-verify-the-zip-archive"><dfn>Step 2</dfn> - <dfn>Verify the Zip Archive</dfn></h3>
  <p id="ta-uLHyIMvLwz">To verify that a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip archive</a> and its <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry" title="file entry">file
    entries</a> conform to this specification, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-zip-archive-0">rule for verifying a zip archive</a>. If the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-zip-archive-0">rule for verifying a zip archive</a> returns <code>true</code>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> go to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-3-set-the-configuration-defaults">Step 3</a>. Otherwise, if the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-verifying-a-zip-archive-0">rule for verifying a zip archive</a> returns an error, then  the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip
    archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
  <h3 class="no-num" id="step-3-set-the-configuration-defaults"><dfn>Step 3</dfn> - Set the Configuration Defaults</h3>
  <p>In <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-3-set-the-configuration-defaults">Step 3</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> set the following variables and
    default values as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of configuration defaults</a>. </p>
  <p class="note"><span class="notetitle">Note:</span> When a <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> value is assigned to a variable in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of
    configuration defaults</a>, a user agent needs to treats
    the value as <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> (i.e., not as an empty string and not as the text string <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">"null"</a></code>).</p>
  <table>
    <caption>
    <dfn id="table-of-configuration-defaults">Table of Configuration Defaults</dfn>
    </caption>
    <thead>
      <tr>
        <th scope="col">Variable</th>
        <th scope="col">Type</th>
        <th scope="col">Overridden in</th>
        <th scope="col">Description</th>
      </tr>
      <tr>
        <th scope="row"><dfn id="author-email-var" title="author email var"><var>author email</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td> The value of the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element's <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="author-href"><var>author href</var></dfn></th>
        <td>IRI</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The value of the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element's <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="author-name"><var>author name</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">localizable string</a> that represents the content of the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="feature-list"><var>feature list</var></dfn></th>
        <td>List</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>A list of features that correspond to features that were requested via <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> elements (if any). Each item in the list corresponds to a <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element's <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> attribute, whether it is required, and any associated <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter" title="parameter&#39;">parameters</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="icons-0"><var>icons</var></dfn></th>
        <td>List of file entries</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-9-process-the-default-icons">Step 9</a></td>
        <td>The icons of the widget as they correspond to the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icon" title="default icon">default icons</a> and to the occurrence of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-icon" title="custom icon">custom icons</a> that are <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="start-file-encoding"><var>start file encoding</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The character encoding of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#custom-start-file-0">custom start file</a>, corresponding
          to either the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code> attribute (if any), or the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-encoding">default encoding</a>.</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="start-file-content-type"><var>start file content-type</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a>, corresponding to the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute or to a media type derived from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start
          files table</a>.</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-config-doc"><var>widget config doc</var></dfn></th>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">File</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-6-locate-the-configuration-document">Step 6</a></td>
        <td>The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> that is the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> for the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-description"><var>widget description</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The text
          content of the <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element in
          the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>.</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-height"><var>widget height</var></dfn></th>
        <td>positive number</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The value of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element's <code title="widget-element height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute">height</a></code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-id-var" title="widget id var"><var>widget id</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td><p> The value of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element's <code>id</code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</p></td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-license"><var>widget license</var></dfn></th>
        <td>String</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The text content of the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
          document</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-license-file"><var>widget license file</var></dfn></th>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">File</a></td>
        <td>Step 7</td>
        <td>A <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> derived if the value of the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element's <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip relative path</a> to a file within the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>.</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-license-href"><var>widget license href</var></dfn></th>
        <td>IRI</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The value of the <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element's <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
          document</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-name"><var>widget name</var></dfn></th>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">Localizable String</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The text content of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
          document</a> (if any).</td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-preferences"><var>widget preferences</var></dfn></th>
        <td>List</td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td><p>The widget's <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference" title="preference">preferences</a>, corresponding to
            the <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> elements in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any). </p>
          <p>Unless an end-user explicitly requests that
            these values be reverted to the values as declared in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>,
            a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must not</em> reset the value of the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-preferences">widget
            preferences</a></var> variable on subsequent initializations of the widget.</p></td>
      </tr>
      <tr>
        <th scope="row"><dfn id="widget-short-name"><var>widget short name</var></dfn></th>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">Localizable String</a></td>
        <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
        <td>The value of the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element's <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</td>
      </tr>
    </thead>
    <tfoot>
      <tr>
        <th scope="col">Variable</th>
        <th scope="col">Type</th>
        <th scope="col">Overridden by</th>
        <th scope="col">Description</th>
      </tr>
    </tfoot>
    <tbody><tr>
      <th scope="row"><dfn id="widget-version"><var>widget version</var></dfn></th>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-string">Localizable String</a></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
      <td>The value of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element's <code title="widget-element version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-version-attribute">version</a></code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</td>
    </tr>
    <tr>
      <th scope="row"><dfn id="widget-width"><var>widget width</var></dfn></th>
      <td>positive number</td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
      <td>The value of the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element's <code title="widget-element width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute">width</a></code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</td>
    </tr>
    <tr>
      <th scope="row"><dfn id="widget-window-modes"><var>widget window modes</var></dfn></th>
      <td>List of strings</td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a></td>
      <td>The value of the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">widget</a></code> element's <code>viewmodes</code> attribute in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> (if any).</td>
    </tr>
    <tr>
      <th scope="row"><dfn id="widget-start-file"><var>widget start file</var></dfn></th>
      <td>File entry</td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-8-locate-the-start-file">Step 8</a></td>
      <td>The <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a> for the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>, corresponding
        to either one of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a> or the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> identified by the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute.</td>
    </tr>
    <tr>
      <th scope="row"><dfn id="user-agent-locales"><var>user agent locales</var></dfn></th>
      <td><p>List of strings</p></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-5-derive-the-user-agent's-locales">Step 5</a></td>
      <td>A  list of <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-tag" title="language tag">language tags</a>. </td>
    </tr>
  </tbody></table>
  <h3 class="no-num done" id="step-4-locate-and-process-the-digital-signature"><dfn>Step 4</dfn> - Locate and Process the Digital Signature</h3>
  <p>If the
    user agent does not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-digsig">[Widgets-DigSig]</a>,  then the user agent <em class="ct">must</em> skip <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-4-locate-and-process-the-digital-signature">Step 4</a> and go to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-5-derive-the-user-agent's-locales">Step 5</a>. Otherwise, the user agent <em class="ct">must</em> apply the algorithm to locate digital signatures, which is defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-digsig">[Widgets-DigSig]</a> specification under the section named <a href="http://www.w3.org/TR/widgets-digsig/#locating-signature-files-in-a-widget-package">Locating signature files in a widget package</a>.</p>
  <h3 class="no-num" id="step-5-derive-the-user-agent&#39;s-locales"><dfn>Step 5</dfn> - Derive the User Agent's Locales</h3>
  <p>The <dfn id="system">end-user's language ranges</dfn> represents the end-user's
    preferred languages and regional settings, which are derived from the operating
    system or directly from the user agent. As there are numerous ways a user agent can
    derive the end-user's preferred languages and regional settings, the means by which
    those values are derived are beyond the scope of this specification and left up to
    the implementation.</p>
  <p>During the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-deriving-the-user-agent-locales-0">rule for deriving the <var>user agent locales</var></a> defined below, the user agent will need to construct a list <var>unprocessed locales</var>. Each item in the <var>unprocessed locales</var> is a  string in lowercase form, that conforms to the production of a <code>Language-Tag</code>, as defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a> specification. A
    string that conforms to the production of a <code>Language-Tag</code> is referred to
    as a <dfn class="external" id="language-range">language range</dfn> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a> (e.g.
    '<code>en-au</code>', which is the range of English as spoken in Australia, and
    '<code>fr-ca</code>', which is the range of French as spoken in Canada, etc.). A
    language range is composed of one or more <dfn id="subtags">subtags</dfn> that are delimited by a
    U+002D HYPHEN-MINUS ("<code>-</code>").</p>
  <p>The first item of the <var>unprocessed locales</var> represents the user's most
    preferred language range (i.e., the language/region combination the user agent
    assumes the end-user most wants to see content in), followed by the next most
    preferred language range, and so forth.</p>
  <p class="example">For example, in an <var>unprocessed locales list</var> that
    contains '<code>en-us,en,fr,es</code>', English as spoken in the United States is
    preferred over English, and English is preferred over French, and French is preferred
    over Spanish, and Spanish is preferred over <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a>.</p>
  <p class="example">For example, the end-user may have specified her preferred
    languages and regional settings at install time by selecting a preferred language, or
    languages from a list, or a list of preferred languages and regional settings could
    have been dynamically derived from the end-user's geographical location, etc. </p>
  <p>In <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-5-derive-the-user-agent's-locales">Step 5</a>, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-deriving-the-user-agent-locales-0">rule for deriving the <var>user agent locales</var></a>.</p>
  <h3 class="no-num done" id="step-6-locate-the-configuration-document"><dfn>Step 6</dfn> - Locate the Configuration Document</h3>
  <p>This step involves searching within the Zip archive for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration
    document</a>.</p>
  <p id="ta-ZjcdAxFMSx">In <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-6-locate-the-configuration-document">Step 6</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a><em class="ct"> must</em> apply the algorithm to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#locate-the-configuration-document">locate the configuration document</a>.</p>
  <p>The algorithm to <dfn id="locate-the-configuration-document">locate the configuration document</dfn> is as follows: </p>
  <ol>
    <li>
      <p>Search at the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#root-of-the-widget-package">root of the widget package</a> for a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file
        entry</a> whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name-field">file name field</a></var> case-sensitively matches the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-configuration-document-file-name">valid configuration document file name</a> (<code>config.xml</code>). </p>
    </li>
    <li>If a
      match is made, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-config-doc">widget config doc</a></var> to the result of applying <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-extracting-file-data-from-a-file-entry-0">rule for extracting file data from a file entry</a> to the matching <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-entry">file entry</a>. If no match is made (meaning that <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-config-doc">widget config doc</a></var> is <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>), then treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-archive-0">Zip
      archive</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</li>
  </ol>
  <h3 class="no-num" id="step-7-process-the-configuration-document"><dfn>Step 7</dfn> - <dfn>Process the Configuration
    Document</dfn></h3>
  <p>The purpose of processing the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> is to override the values in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of configuration defaults</a>, which are used during <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#initialization">initialization</a> and at runtime, and to select the appropriate localized
    content (if any) to be presented to the end user.</p>
  <p>In conjunction to the algorithm for processing a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> given below, this section firstly defines some terminology used by the processing algorithm
    and describes how localized elements are processed.</p>
  <p>During <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-7-process-the-configuration-document">Step 7</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#algorithm-to-process-a-configuration-document-0">algorithm to process a configuration document</a>.</p>
  <h4 id="terminology-used-in-processing-algorithm"><span class="secno">9.1.1 </span>Terminology Used in Processing Algorithm</h4>
  <p>In the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#algorithm-to-process-a-configuration-document-0">algorithm to process a configuration document</a>, the term <dfn id="in-error">in error</dfn> is used to mean that an element, or
    attribute, or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> is
    non-conforming to the rules of this specification. How an element or an attribute is to
    be treated when it is in error is always given when the term is used; but will
    generally require the user agent to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> any element, attribute, or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> that is in error.</p>
  <p> To <dfn id="ignore">ignore</dfn> means to act as if the element, attribute, or file that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> is
    absent (i.e., not declared or included by the author) in the widget package or configuration document. A user agent <em class="ct">must</em>, however, keep a record of all element types it has attempted to process even if they were ignored (this is to determine if the user agent has attempted to process an element of a given type already). </p>
  <p>In the case the user agent is asked to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> element or node,  a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> :</p>
  <ol>
    <li>
      <p>Stop processing the current <var>element</var>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore" title="ignore">ignoring</a> all of the <var>element</var>'s attributes and child nodes (if any), and proceed to the next <var>element</var> in the <var>elements list</var>.</p>
    </li>
    <li>
      <p>Make a record  that it has attempted to process an element of that type.</p>
    </li>
  </ol>
  <div class="example">
    <p>In the following example, the user agent ignores both <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> elements. The user agent ignores the first  because it lacks a <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute. The user agent ignores the second  because  it is not the first content element to be encountered by the user agent. </p>
    <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
	&lt;!-- User agent ignores the first, but records 
       that it has attempted to process a content element 
   --&gt;

  &lt;content/&gt;
  
  &lt;!-- The use agent knows that it has previously attempted 
       to process a content element, hence this content element 
       is ignored. 
   --&gt;
 
  &lt;content src="cats.html"/&gt;
&lt;/widget&gt; </code></pre>
  </div>
  <p>To <dfn id="associate">associate</dfn> means that two or more pieces of information are bound and
    stored together for the purpose of later processing (e.g., the name of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>, and if it is <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code>, and any associated <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter" title="parameter">parameters</a>). How associated data is represented is left
    up-to the implementation (e.g., a user agent could use an array, an object, a hash map,
    etc.).</p>
  <p>The <dfn class="external" id="lookup"><a href="http://tools.ietf.org/html/bcp47#page-2-12">lookup</a></dfn> algorithm is defined in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#bcp47">[BCP47]</a>. It is used in this Step  to
    match <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localized-content">localized content</a> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> to the
    language ranges held by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> (if any).</p>
  <h4 id="algorithm-to-process-a-configuration-document"><span class="secno">9.1.2 </span>Algorithm to Process a Configuration Document</h4>
  <p>The <dfn id="algorithm-to-process-a-configuration-document-0">algorithm to process a configuration document</dfn> is as follows:</p>
  <ol>
    <li>
      <p>Let <var>doc</var> be the result of loading the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-config-doc">widget config doc</a></var> as
        a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#dom3core">[DOMCore]</a> <code>Document</code> using an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> parser that is both <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xmlns">[XMLNS]</a>-aware      and <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> aware. </p>
    </li>
    <li>
      <p id="ta-klLDaEgJeU">If <var>doc</var> is not namespace well-formed <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> terminate this
        algorithm and treat this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
    </li>
    <li>
      <p>Let <var>root element</var> be the <code>documentElement</code> of <var>doc</var>.</p>
    </li>
    <li>
      <p id="ta-ACCJfDGwDQ">If the <var>root element</var> is not a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-namespace">widget namespace</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> terminate this
        algorithm and  treat this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
    </li>
    <li>
      <p>Otherwise, the <var>element</var> is a <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element:</p>
      <ol>
        <li>
          <p>If the <code>defaultlocale</code> attribute is used, then let <var> default locale </var> be the result of
            applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</a> to the <code>defaultlocale</code> attribute:</p>
          <ol>
            <li>
              <p id="ta-defaultlocale-ignore">If the<var> default locale </var>is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> or an empty string or already contained by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the <code>defaultlocale</code> attribute. </p>
            </li>
            <li>
              <p id="ta-defaultlocale-process">If <var>potential default locale </var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-language-tag">valid language tag</a> and the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> does not contain the value of <var> default locale</var>, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> prepend the value of <var> potential default locale </var>into the the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list as the second-last item (i.e., at position length - 1). </p>
              <div class="example">
                <p> For example,         
                  
                  if the <var> default locale </var>is the value "<code>fr</code>", and the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> contains the values "<code>jp,us,*</code>", then the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list becomes "<code>jp,us,fr,*</code>". </p>
                <p> For example,         
                  
                  if the <var> default locale </var>is the value "<code>en</code>", and the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> only contains the value "<code>*</code>", then the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list becomes "<code>en,*</code>". </p>
                <p> For example,         
                  
                  if the <var> default locale </var>is the value "<code>en</code>", and the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> already contains the values "<code>en,*</code>", then the user agent would ignore the <var> default locale </var>because it is already contained by the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> list. </p>
              </div>
            </li>
          </ol>
        </li>
        <li>
          <p id="ta-RawAIWHoMs">If the <code>id</code> attribute is used, then let <var>id</var> be the result of
            applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</a> to the <code>id</code> attribute. If <var>id</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, then
            let <var title="widget id var"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-id-var">widget id</a></var> be the value of the <var>id</var>. If the <var>id</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a> or is an empty string, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute.</p>
        </li>
        <li>
          <p id="ta-VerEfVGeTc">If the <code>version</code> attribute is used, then let <var> version value</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single
            attribute value</a> to the <code>version</code> attribute. If the <var>version</var> is an empty string, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute; otherwise, let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-version">widget version</a></var> be the value of <var>version value</var>.</p>
        </li>
        <li>
          <p id="ta-BxjoiWHaMr">If the <code>height</code> attribute is used, then let <var>normalized
            height</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-parsing-a-non-negative-integer-0">rule for parsing a
            non-negative integer</a> to the value of the attribute. If the <var>normalized height</var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and greater than <code>0</code>, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-height">widget height</a></var> be the value of <var>normalized
            height</var>. If the <code>height</code> attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute.</p>
        </li>
        <li>
          <p id="ta-UScJfQHPPy">If the <code>width</code> attribute is used, then let <var>normalized
            width</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-parsing-a-non-negative-integer-0">rule for parsing a non-negative
            integer</a> to the value of the attribute. If the <var>normalized
            width</var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and greater than <code>0</code>, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-width">widget width</a></var> be the value of <var>normalized width</var>. If the <code>width</code> attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute.</p>
        </li>
        <li>
          <p id="ta-viewmodes">If the <code>viewmodes</code> attribute is used, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> let <var>viewmodes
            list</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-list-of-keywords-from-an-attribute-0">rule for getting a list of
            keywords from an attribute</a>:</p>
          <ol>
            <li>
              <p>From the <var>viewmode list</var>, remove
                any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> items. </p>
            </li>
            <li>
              <p>From the <var>viewmode list</var>, remove
                any duplicated items from right to left.</p>
              <p class="example">For example, <var>viewmode list</var> with a value of "<code>windowed  fullscreen windowed floating fullscreen windowed</code>" would become "<code>windowed  fullscreen floating</code>".</p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-window-modes">widget window
                modes</a></var> be the value of <var>viewmodes list</var>.</p>
            </li>
          </ol>
        </li>
      </ol>
    </li>
    <li>
      <p id="ta-MFcsScFEaC">If the <code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code> element does not contain
        any child elements, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> terminate this
        algorithm and go to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-8-locate-the-start-file">Step
        8</a>.</p>
    </li>
    <li>
      <p>Otherwise, let <dfn id="element-list"><var>element list</var></dfn> be an empty list. </p>
    </li>
    <li>
      <p>For each <var>range</var> in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var>, starting from
        the first and moving to the last:</p>
      <ol>
        <li>
          <p>If the value of <var>range</var> is not "*", then retaining <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a>, let <var>matching elements</var> be the result of applying <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#lookup">lookup</a> to the  child  elements that are defined as being <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-via-xml:lang">localizable via <code>xml:lang</code></a> (i.e., the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code>, <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code>, and <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> elements) that are direct descendants of the <var>root
            element</var> and whose <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code> attribute matches the current <var>range</var>. Append <var>matching elements</var> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-list">element list</a></var>.</p>
          <p class="note"><span class="notetitle">Note:</span> In the context of this specification, the above conformance requirement is intended to match the <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code>, <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code>, and <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> elements. However, it is written in an abstract manner to provide a hook for future specifications that want to define elements that also support being <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#localizable-via-xml:lang">localizable via xml:lang</a>.</p>
        </li>
        <li>If the value of  range is "*", retaining <a href="http://www.w3.org/TR/xpath/#dt-document-order">document order</a>, let <var>unlocalized elements</var> be all child elements that are direct
          descendants of the <var>root element</var> that do not have an implicit or explicit <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></var> attribute (i.e., match <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-content">default content</a>). Append <var>unlocalized elements</var> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#element-list">element list</a></var>.
          <div class="example">
            <p>For example, consider the following configuration document.</p>
            <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt;
&lt;name&gt;El Widget!&lt;/name&gt;
&lt;name xml:lang="fr"&gt;Le Widget&lt;/name&gt;
&lt;name xml:lang="en"&gt;The Widget&lt;/name&gt;
&lt;/widget&gt; </code></pre>
            <p>For a use agent whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> contains "<code>en,fr,*</code>", the <var>matching elements</var> would be in the following order: </p>
            <ol>
              <li><code>&lt;name xml:lang="en"&gt;The Widget&lt;/name&gt;</code></li>
              <li><code>&lt;name xml:lang="fr"&gt;Le Widget&lt;/name&gt;</code></li>
              <li><code>&lt;name&gt;El Widget!&lt;/name&gt;</code></li>
            </ol>
            <p>For a use agent whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> contains "<code>en,*</code>", the <var>matching elements</var> would be in the following order: </p>
            <ol>
              <li><code>&lt;name xml:lang="en"&gt;The Widget&lt;/name&gt;</code></li>
              <li><code>&lt;name&gt;El Widget!&lt;/name&gt;</code></li>
            </ol>
            <p>For a use agent whose <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent-locales">user agent locales</a></var> contains "<code>jp,*</code>", the <var>matching elements</var> would be in the following order: </p>
            <ol>
              <li><code>&lt;name&gt;El Widget!&lt;/name&gt;</code></li>
            </ol>
          </div>
        </li>
      </ol>
    </li>
    <li>
      <p>For each <var>element</var> in the <var>elements list</var>, if the <var>element</var> is one of the following:</p>
      <dl class="procedure">
        <dt>A <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element:</dt>
        <dd>
          <p id="ta-LYLMhryBBT">If this is not the first <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
        </dd>
        <dd>
          <p id="ta-AYLMhryBnD">If this is the first <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em>:</p>
          <ol>
            <li>
              <p>Record that an attempt has been made by the user agent to process a <code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code> element.</p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-name">widget name</a></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-with-normalized-white-space-0">rule for
                getting text content with normalized white space</a> to this
                element.</p>
            </li>
            <li>
              <p>If the <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute is used, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-short-name">widget short
                name</a></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single
                attribute value</a> to the <code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code> attribute.</p>
            </li>
          </ol>
        </dd>
        <dt>A <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element:</dt>
        <dd>
          <p id="ta-UEMbyHERkI">If this is not the first <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
        </dd>
        <dd>
          <p id="ta-VdCEyDVSA">If this is the first <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em>: </p>
          <ol>
            <li>
              <p>Record that an attempt has been made by the user agent to process a <code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code> element. </p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-description">widget description</a></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-0">rule for getting text content</a> to this element.</p>
            </li>
          </ol>
        </dd>
        <dt>A <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element:</dt>
        <dd>
          <p id="ta-vcYJAPVEym">If this is not the first <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
        </dd>
        <dd>
          <p id="ta-YUMJAPVEgI">If this is the first <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element
            used,  then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em>:</p>
          <ol>
            <li>
              <p> Record that an attempt has been made by the user agent to process a <code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code> element. </p>
            </li>
            <li>
              <p>Let <var>license text</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-0">rule for
                getting text content</a> to this element. <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>license text</var> with <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-license">widget license</a></var>. </p>
            </li>
            <li>
              <p>If the <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute is used, then let <var>potential license href</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a
                single attribute value</a> to the <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute.</p>
            </li>
            <li>
              <p> If <var>potential license href</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a> or a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid
                path</a>, then the <code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code> attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute. </p>
            </li>
            <li>
              <p>If <var>potential license href</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-license-href">widget license href</a></var> be the value of <var>potential license href</var>. </p>
            </li>
            <li>
              <p>If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">license href</a></var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a>, then let <var title=""> file</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package-0">rule for
                finding a file within a widget package</a> to <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">license href</a></var>. </p>
            </li>
            <li>
              <p>If <var title="">file</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>,
                as determined by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a
                file</a>, then <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
            </li>
            <li>
              <p>Otherwise, let <var title="">widget license</var> <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> be the value of <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var>. </p>
            </li>
          </ol>
        </dd>
        <dt>An <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element:</dt>
        <dd>
          <p id="ta-iipTwNshRg">If the <code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code> attribute of this <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element is absent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
        </dd>
        <dd>
          <p id="ta-roCaKRxZhS">Let <var>path</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a
            single attribute value</a> to the <code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code> attribute of this <code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code> element. If path is
            not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a> or is an empty string, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
        </dd>
        <dd>
          <p id="ta-iuJHnskSHq">Let <var title="">file</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package-0">rule for
            
            finding a file within a widget package</a> to <var>path</var>. If <var title="">file</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, as
            determined by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a
            file</a>, or already exists in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icons-0">icons</a></var> list, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this element. </p>
        </dd>
        <dd>
          <p>Otherwise,</p>
          <ol>
            <li>
              <p id="ta-eHUaPbgfKg">If the <code title="icon height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0">height</a></code> attribute is used, then let <var>potential <code>height</code></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-parsing-a-non-negative-integer-0">rule for parsing a non-negative integer</a> to the attribute's
                value. If the <var>potential <code>height</code></var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in
                error</a> and greater than <code>0</code>, then <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">associate</a> the <var>potential <code>height</code></var> with <var title="">file</var>.
                Otherwise, the <code title="icon height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0">height</a></code> attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute.</p>
            </li>
            <li>
              <p id="ta-nYAcofihvj">If the <code title="icon width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0">width</a></code> attribute is used, then let <var>potential width</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-parsing-a-non-negative-integer-0">rule for
                parsing a non-negative integer</a> to the attribute's value. If the <var>potential width</var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and greater than <code>0</code>, then <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">associate</a> the <var>potential width</var> with <var title="">file</var>. Otherwise, the <code title="icon width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0">width</a></code> attribute is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in
                error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the attribute.</p>
            </li>
            <li>
              <p>Add <var title="">file</var> and any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate" title="associate">associated</a> <var>potential width</var> and/or <var>potential height</var> to the list of <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icons-0">icons</a></var>.</p>
            </li>
          </ol>
        </dd>
        <dt>An <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element:</dt>
        <dd>
          <p id="ta-sdwhMozwIc">If this is not the first <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
        </dd>
        <dd>
          <p id="ta-argMozRiC">If this is the first <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element
            used,  then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em>: </p>
          <ol>
            <li>
              <p> Record that an attempt has been made by the user agent to process a <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element. </p>
            </li>
            <li>
              <p>If the <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute is used,
                then let <var>href-value</var> be the value of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute.</p>
            </li>
            <li>
              <p>If <var>href-value</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#author-href">author href</a></var> be the value of the <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute. Otherwise, if <var>href-value</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, then <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the <code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code> attribute.</p>
            </li>
            <li>
              <p>If the <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute is used, then let <var title="author email var"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#author-email-var">author
                email</a></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</a> to the <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute.</p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#author-name">author name</a></var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-text-content-with-normalized-white-space-0">rule for
                getting text content with normalized white space</a> to this
                element.</p>
            </li>
          </ol>
        </dd>
        <dt>A <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element:</dt>
        <dd>
          <p id="ta-DwhJBIJRQN">If a <code title="preference value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0">value</a></code> attribute of the <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element is used, but the <code title="preference name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1">name</a></code> attribute is absent, then this <code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code> element is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. Otherwise, the user agent <em class="ct">must</em>: </p>
        </dd>
        <dd>
          <ol>
            <li>
              <p>Let <var>name</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule
                for getting a single attribute value</a> to the <code title="preference name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1">name</a></code> attribute.</p>
            </li>
            <li>
              <p>If the <var>name</var> is an empty string, then this <var>element</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a>; <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
            </li>
            <li>
              <p>If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-preferences">widget preferences</a></var> already contains a preference whose name case-sensitively matches the value of <var>name</var>,  then this <var>element</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a>; <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
            </li>
            <li>
              <p>If <var>name</var> was not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a>, let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a></var> be an empty object.</p>
            </li>
            <li>
              <p>Associate <var>name</var> with <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a></var>. </p>
            </li>
            <li>
              <p>Let <var>value</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule
                for getting a single attribute value</a> to the <code title="preference value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0">value</a></code> attribute.</p>
            </li>
            <li>
              <p><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>value</var> with <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a></var>.</p>
            </li>
            <li>
              <p>If a <code title="preference readonly"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-readonly-attribute">readonly</a></code> attribute is used, then let <var>readonly</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the <code title="preference readonly"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-readonly-attribute">readonly</a></code> attribute. If <var>readonly</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-boolean-value">valid boolean
                value</a>, then let the value of <var>readonly</var> be the value
                '<code>false</code>'. </p>
            </li>
            <li>
              <p><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>readonly</var> with
                the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a></var>.</p>
            </li>
            <li>
              <p>Add the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#preference">preference</a></var> and the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate" title="associate">associated</a> <var>name</var>, <var>value</var> and <var>readonly</var> variables the list of <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-preferences">widget preferences</a></var>.</p>
            </li>
          </ol>
        </dd>
      </dl>
      <dl class="procedure">
        <dt id="process-content-elemenent">A <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element:</dt>
        <dd>
          <p id="ta-hkWmGJgfve">If this is not the first <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element encountered by the user agent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
        </dd>
        <dd>
          <p>If this is the first <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element,  then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em>:</p>
        </dd>
        <dd>
          <ol>
            <li>
              <p> Record that an attempt has been made by the user agent to process a <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element. </p>
            </li>
            <li>
              <p id="ta-LTUJGJFCOU">If the <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute of the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element is absent or an empty string, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
            </li>
            <li>
              <p>Let <var>path</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting
                a single attribute value</a> to the value of the <code>src</code> attribute.</p>
            </li>
            <li>
              <p id="ta-pIffQywZin">If <var>path</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
            </li>
            <li>
              <p id="ta-LQcjNKBLUZ">If <var>path</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-path">valid path</a>, then let <var title="">file</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package-0">rule for finding a file
                within a widget package</a> to <var>path</var>. If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a></var> is <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> or in error, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
            </li>
            <li>
              <p>If the <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute of the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element is absent, then check
                if <var title="">file</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent by
                applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a file</a>. If
                the <var title="">file</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a>, then let the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-start-file">widget
                start file</a></var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> referenced by the <code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code> attribute and let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-content-type">start file
                content-type</a></var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> as
                was derived by applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-identifying-the-media-type-of-a-file-0">rule for identifying the media type of a
                file</a>.</p>
            </li>
            <li>
              <p id="ta-dPOgiLQKNK">If the <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code> attribute is used, then let <var>content-encoding</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the value of the <code>encoding</code> attribute. If the character encoding  represented by the value of <var>content-encoding</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent, then let the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-encoding">start file
                encoding</a></var> be the value of <var>content-encoding</var>. If <var>content-encoding</var> is an empty string or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> by the user agent,
                then a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code> attribute.</p>
            </li>
            <li>
              <p id="ta-paIabGIIMC">If the <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute is used, then let <var>content-type</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the value of the <code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code> attribute. If the value of <var>content-type</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent, then
                let the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-content-type">start file content-type</a></var> be the value of <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">content
                type</a></var>. If value of <var>content-type</var> is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid">invalid</a> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unsupported">unsupported</a> by the user agent, then a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. </p>
            </li>
            <li>
              <p id="ta-aaaaaaaaaa"> If the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-encoding">start file encoding</a></var> was set in step 7 of this algorithm as a result of processing a valid and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> value for the <code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code> element's <code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code> attribute, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> skip this step in this algorithm. Otherwise, if the value of <var>content-type</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user agent and if <var>content-type</var> contains one or more <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime">[MIME]</a> <code title="mime parameter"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime-parameter">parameter</a></code> components whose purpose is to  declare the character encoding of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a> (e.g., the value "<samp>text/html;charset=Windows-1252</samp>",  where <samp>charset</samp> is a parameter component whose purpose is to declare the character encoding of the start file), then let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-encoding">start file encoding</a></var> be the value of the last <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> <code title="mime parameter"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime-parameter">parameter</a></code> components whose purpose is to  declare the character encoding of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file">start file</a>. </p>
              <div class="example">
                <p>In the following example, the user agent would set the start file encoding to ISO-8859-1 and would ignore the charset parameter used in the type attribute. </p>
                <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt; <br>  &lt;content src      = "start.php" 
           type     = "text/html;charset=Windows-1252" 
           encoding = "ISO-8859-1" /&gt;<br>&lt;/widget&gt;</code></pre>
                <p>In the following example the user agent would set the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-encoding">start file encoding</a></var> to <code>Windows-1252</code>, if the user agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> that character encoding. </p>
                <pre><code>&lt;widget xmlns="http://www.w3.org/ns/widgets"&gt; 
  &lt;content src  = "start.php" 
           type = "text/html;charset=Windows-1252"/&gt;
&lt;/widget&gt;</code></pre>
              </div>
            </li>
          </ol>
        </dd>
      </dl>
      <dl class="procedure">
        <dt>A <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">param</a></code> element:</dt>
        <dd>
          <p id="ta-KNiLPOKdgQ"> If this <code title="param elemement">param</code> element  is not a direct child of a <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> <var>element</var>.</p>
        </dd>
        <dd>
          <p class="note"><span class="notetitle">Note:</span> How a param element is to be processed when it is inside a feature element is defined below.</p>
        </dd>
      </dl>
      <dl class="procedure">
        <dt>A <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element:</dt>
        <dd>
          <p id="ta-rZdcMBExBX">The <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> process a feature element in the following manner: </p>
        </dd>
        <dd>
          <ol>
            <li>
              <p>If the <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code> attribute of this <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element is absent, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
            </li>
            <li>
              <p>Let <var>required-feature</var> be the value <code>true</code>. </p>
            </li>
            <li>
              <p>If a <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute is used, then let <var>potentialy-required-feature</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the <code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code> attribute. If the value of <var>potentialy-required-feature</var> is the value "<code>false</code>", then let <var>required-feature</var> be the value
                '<code>false</code>'. </p>
            </li>
            <li>
              <p>Let <var>feature-name</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for
                getting a single attribute value</a> to the value of the <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code> attribute.</p>
              <p class="note"><span class="notetitle">Note:</span> This specification allows <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> elements with the same <code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code> attribute value to be declared more than once. Handling of duplicate <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature-request" title="feature request">feature requests</a> is left up to the implementation or the specification that defines the feature. </p>
            </li>
            <li>
              <p id="ta-paWbGHyVrG">If <var>feature-name</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, and <var>required-feature</var> is <code>true</code>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat this widget as
                an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>. </p>
            </li>
            <li>
              <p id="ta-ignore-unrequired-feature-with-invalid-name">If <var>feature-name</var> is not a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#valid-iri">valid IRI</a>, and <var>required-feature</var> is <code>false</code>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this element. </p>
            </li>
            <li>
              <p id="ta-vOBaOcWfll">If <var>feature-name</var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user
                agent, and <var>required-feature</var> is <code>true</code>, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> treat this widget as
                an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
            </li>
            <li>
              <p id="ta-luyKMFABLX">If <var>feature-name</var> is not <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user
                agent, and <var>required-feature</var> is <code>false</code>, then  the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a></var> be an object that represents this <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>. <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>required-feature</var> and <var>feature-name</var> with the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a></var> object.</p>
            </li>
            <li>
              <p>If the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element contains any <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> elements as direct descendants, then, for each child <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element that is a direct descendants of this <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element, starting from the first moving to
                the last in <a href="http://www.w3.org/TR/xpath/#dt-document-order">document
                order</a>:</p>
              <ol style="list-style-type:upper-alpha">
                <li>
                  <p id="ta-EGkPfzCBOz">If  either the a <code title="param name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0">name</a></code> attribute or  the <code title="param value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute">value</a></code> attribute is missing, then this <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>.</p>
                </li>
                <li>
                  <p>Let <var>param-name</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule
                    for getting a single attribute value</a> to the <code title="param name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0">name</a></code> attribute. </p>
                </li>
                <li>
                  <p id="ta-CEGwkNQcWo">If <var>param-name</var> is an
                    empty string, then this <code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code> element is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in
                    error</a> and the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>element</var>. </p>
                </li>
                <li>
                  <p>Let <var>param-value</var> be the result of
                    applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-getting-a-single-attribute-value-0">rule for getting a single attribute value</a> to
                    the <code title="param value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute">value</a></code> attribute.</p>
                </li>
                <li>
                  <p>L:et <var>param</var> be an object that represents this paramenter. </p>
                </li>
                <li>
                  <p><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>param-name</var> and <var>param-value</var> with <var>param</var>.</p>
                </li>
                <li>
                  <p><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#associate">Associate</a> <var>param</var> with <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a></var>.</p>
                </li>
              </ol>
            </li>
            <li>
              <p>Append <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a></var>, to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature-list">feature list</a></var>.</p>
            </li>
          </ol>
        </dd>
        <dt><dfn id="process-any-element">Any other type of element</dfn>:</dt>
        <dd>
          <p id="ta-bbbbbbbbbb">If the user agent <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">supports</a> the element, then the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> process it in accordance with whatever specification defines that element (if any). Otherwise, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> the element.</p>
        </dd>
      </dl>
    </li>
  </ol>
  <h3 class="no-num done" id="step-8-locate-the-start-file"><dfn>Step 8</dfn> - Locate the Start File</h3>
  <p id="ta-BnWPqNvNVo">If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-start-file">widget start file</a></var> of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of configuration defaults</a> contains a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a> (i.e. <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-start-file">widget start file</a></var> is not <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code>), then a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> skip <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-8-locate-the-start-file">Step 8</a> and go
    to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-9-process-the-default-icons">Step 9</a>. </p>
  <p id="ta-RGNHRBWNZV">If <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-start-file">widget start file</a></var> does not contain a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a>, the <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#algorithm-to-locate-a-default-start-file">algorithm to locate a default start file</a>.</p>
  <p>The <dfn id="algorithm-to-locate-a-default-start-file">algorithm to locate a default start file</dfn> is as follows: </p>
  <ol>
    <li>
      <p>For each <var>file name</var> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a> (from
        top to bottom) that has a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by
        the user agent:</p>
      <ol>
        <li>
          <p>Let <var>potential-start-file</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package-0">rule
            for finding a file within a widget package</a> to <var>file name</var>.</p>
        </li>
        <li>
          <p>If <var>potential-start-file</var> is <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#null">null</a></code> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#in-error">in
            error</a>, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ignore">ignore</a> this <var>file name</var> and move onto the
            next <var>file name</var> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files table</a>.</p>
        </li>
        <li>
          <p>If <var>potential</var><var>-start-file</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file">file</a>, then:</p>
          <ol>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-start-file">widget start file</a></var> be the value of <var>potential-</var><var>start-file</var>.</p>
            </li>
            <li>
              <p>Let <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#start-file-content-type">start file content-type</a></var> be the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> given in the media type column of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start files
                table</a>.</p>
            </li>
            <li>
              <p>Terminate this algorithm and go to <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-9-process-the-default-icons">Step 9</a>.</p>
            </li>
          </ol>
        </li>
      </ol>
    </li>
    <li>
      <p>If after searching for every <var title="">file</var> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-start-files-table">default start
        files table</a> no default start file is found, then treat this widget as an <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#invalid-widget-package-0">invalid widget package</a>.</p>
    </li>
  </ol>
  <h3 class="no-num done" id="step-9-process-the-default-icons"><dfn>Step 9</dfn> - Process the Default Icons</h3>
  <p>This step describes how to locate the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table" title="default icons table">default
    icons</a>.</p>
  <p id="ta-FAFYMEGELU">In <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#step-9-process-the-default-icons">Step 9</a>, a <a class="product-ua" href="http://www.w3.org/TR/2012/REC-widgets-20121127/#user-agent">user agent</a> <em class="ct">must</em> apply the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#algorithm-to-locate-the-default-icons">algorithm to locate the default icons</a>.</p>
  <p>The <dfn id="algorithm-to-locate-the-default-icons">algorithm to locate the default icons</dfn> is as follows:</p>
  <ol>
    <li>
      <p>For each <var>file name</var> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons table</a> (from top to
        bottom) that has a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> that is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported">supported</a> by the user
        agent:</p>
      <ol>
        <li>
          <p>Let <var>potential-icon</var> be the result of applying the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#rule-for-finding-a-file-within-a-widget-package-0">rule for
            finding a file within a widget package</a> to <var>file name</var>.</p>
        </li>
        <li>
          <p>If the <var>potential-icon</var> is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#processable-file">processable file</a>, determined
            by the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-0">media type</a> given in the media type column of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons table</a>, and the <var>potential-icon</var> does not already exist in the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icons-0">icons</a></var> list of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of configuration defaults</a>, then append the value of <var>potential-icon</var> to the <var><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#icons-0">icons</a></var> list of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#table-of-configuration-defaults">table of
            configuration defaults</a>. </p>
        </li>
        <li>
          <p>Move onto the next <var>file name</var> in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#default-icons-table">default icons
            table</a>.</p>
        </li>
      </ol>
    </li>
  </ol>
  <h2 class="no-num" id="appendix">Appendix</h2>
  <h3 class="no-num" id="media-type-registration-for-application/widget">Media Type Registration for <code>application/widget</code></h3>
  <p>This appendix is the MIME media type registration for "<code>application/widget</code>". This registration has been <a href="http://www.iana.org/assignments/media-types/application/">approved</a> by the Internet Assigned Numbers Authority (<abbr title="Internet Assigned Numbers Authority">IANA</abbr>) . </p>
  <p>Registration with <abbr title="Internet Assigned Numbers Authority">IANA</abbr> was conducted in conformance with <a href="http://www.ietf.org/rfc/rfc4288.txt">BCP 13</a> and <a href="http://www.w3.org/2002/06/registering-mediatype.html">W3CRegMedia</a>. </p>
  <dl>
    <dt>Type name: </dt>
    <dd>
      <p><code>application</code></p>
    </dd>
    <dt>subtype name:</dt>
    <dd>
      <p><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget">widget</a></code></p>
    </dd>
    <dt>Required parameters:</dt>
    <dd>
      <p>None.</p>
    </dd>
    <dt> Optional parameters:</dt>
    <dd>
      <p> None.</p>
    </dd>
    <dt>Encoding considerations:</dt>
    <dd>
      <p>Widget packages are binary data and thus are encoded for MIME 
        transmission. As a widget package is binary, it requires encoding on transports not capable of
        handling binary. The same guidelines that apply to <code>application/octet-stream</code> apply to widget packages (see <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#mime">[MIME]</a>). </p>
    </dd>
    <dt>Security  considerations:</dt>
    <dd>
      <p>In addition to the security considerations specified for Zip files in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-mime">[Zip-MIME]</a> registration, there are a number of security considerations that need to be taken into account when dealing with <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package" title="widget package">widget packages</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0" title="configuration document">configuration documents</a>. </p>
      <p>As the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0"> configuration document</a> format is <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml">[XML]</a> and will commonly be encoded using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#unicode">[Unicode]</a>, the security considerations described in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#xml-mime">[XML-MIME]</a> and <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#refsUTR">[UTR36]</a> apply. In addition, implementers need to impose their own implementation-specific limits on the values of otherwise unconstrained attribute types, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around platform-specific limitations.</p>
      <p>The configuration document allows authors, through the <code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code> element, to request permission to enable  third-party runtime components and APIs. As these features are outside the scope of this specification, significant caution needs to be taken when granting a widget the capability to use a feature. Features themselves  define their own security considerations. </p>
      <p><span class="widget package">Widget packages</span> will generally contain ECMAscript, HTML, CSS files, and other media, which are executed in a sand boxed environment. As such, implementers need to be aware of the security implications for the types they <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#supported" title="supported">support</a>. Specifically, implementers need to consider the security implications outlined in the [CSS-MIME] specification, the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#ecmascript-mime">[ECMAScript-MIME]</a> specification, and the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html-mime">[HTML-MIME]</a> specification. </p>
      <p>As widget packages can contain content that is able to simultaneously interact with the local device and  a remote host, implementers need to consider the privacy implications resulting from  exposing private information to a remote host.  Mitigation and in-depth defensive measures are an implementation responsibility and not prescribed by this specification. However, in designing these measures, implementers are advised to enable user awareness of information sharing, and to provide easy access to interfaces that enable revocation of permissions. </p>
      <p> As this specification relies on the standardized heuristics for determining the content type of files defined in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sniff">[SNIFF]</a> specification, implementers need to consider  the security considerations discussed in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sniff">[SNIFF]</a> specification.</p>
      <p>As this specification allows for the declaration of IRIs within certain elements of a configuration documents, implementers need to consider  the security considerations discussed in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri">[IRI]</a> specification. Implementations intending to display <abbr title="Internationalized Resource Identifiers">IRIs</abbr> and <abbr title="Internationalized domain name">IDNA</abbr> addresses found in the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> are strongly encouraged to follow the security advice given in <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#refsUTR">[UTR36]</a>. This could include, for example,  behaving as if the <code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code> attribute had no effect on any <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute" title="IRI attribute">IRI attributes</a>,, <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute" title="path attribute">path attributes</a>, and the <code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code> element's <code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code> attribute.</p>
      <p>In addition, user agents  need to be careful about trusting path components  
        found in the widget package. Such path components might be interpreted  
        by operating systems as pointing at security critical files outside  
        the widget environment proper, and naive unpacking of widget  
        packages into the file system might lead to undesirable and security  
        relevant effects, such as overwriting of  system files. </p>
    </dd>
    <dt>Interoperability considerations:</dt>
    <dd>
      <p>Some issues can arise with regards to character encodings of file names, the length of zip relative paths, and the use of certain strings as file names. </p>
      <p>This specification does not put a restriction on the byte length of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip
        relative path</a>, so a user agent <em class="ct">should</em> to be able to deal with <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path" title="Zip relative path">Zip relative paths</a> that have lengths longer than 250 bytes. As some operating systems have restrictions on how long a path length can be, authors need to keep the lengths of relative paths at less than 250 bytes. Unicode code points may
        require more than one byte to encode a character, which can result in a path whose
        length is less than 250 characters but whose size is greater than 250 bytes. </p>
      <p>Authors need to be aware that, at the time of publication, there are
        interoperability issues with regards to using characters outside the <code>safe-chars</code> range for file or folder names in a Zip archive when using
        Zipping tools bundled with operating systems. The interoperability issues have
        arisen from non-conforming implementations of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip">[ZIP]</a> specification
        across operating systems: very few, if any, correctly support encoding file names
        in Unicode.</p>
      <p>In the case where the Zip relative path is encoded using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#utf-8">[UTF-8]</a>, the <dfn class="external" id="language-encoding-flag-(efs)">language encoding flag (EFS)</dfn> needs to be set.</p>
      <p>If an author chooses to use the <code>utf8-chars</code>, they need to thoroughly
        test their widgets on various platforms prior to distribution; otherwise it is
        suggested that authors restrict file and folder names to the <code>safe-chars</code> (characters in the US-ASCII range). In addition, having
        excessively long path names (e.g. over 120 characters) can also result in
        interoperability issues on some operating systems. </p>
      <p> Authors need to avoid using <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-forbidden-characters">Zip forbidden
        characters</a> when naming the files used by a widget. These characters are reserved to
        maintain interoperability across various file systems and with <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#uri">[URI]</a>s.</p>
      <p>Authors need to avoid using the following words as either a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#folder"><code>folder</code></a> or
        a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#file-name"><code>file-name</code></a> in a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#zip-relative-path">Zip relative path</a> as they
        are reserved by some operating systems (case-insensitive): CON, PRN, AUX, NUL,
        COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5,
        LPT6, LPT7, LPT8, LPT9, CLOCKS$. For example, the following names are ok:
        "CON-tact.txt", "printer.lpt1", "DCOM1.pdf". However, "com3.txt" "Lpt1", "CoM9.gif"
        
        would not be.</p>
      <p>In addition,  authors need to avoid having a "." U+002E FULL STOP as the last character of a
        file or folder name as some operating systems will remove the character when the
        file is extracted from the Zip archive onto the device. Furthermore, avoid having
        the space character (<a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#sp">SP</a>) at the start or end of a file name; and take
        caution when using the "+" U+002B PLUS SIGN, as it might cause issues on some
        operating systems.</p>
    </dd>
    <dt>Published specification:</dt>
    <dd>
      <p><a href="http://www.w3.org/TR/widgets/">http://www.w3.org/TR/widgets/</a></p>
    </dd>
    <dt>Applications that use this media type:</dt>
    <dd>
      <p>User agents that claim conformance to this specification. </p>
    </dd>
    <dt>Magic number(s):</dt>
    <dd>
      <p><code>50 4B 03 04</code></p>
    </dd>
    <dt> File extension(s):</dt>
    <dd>
      <p>wgt</p>
    </dd>
    <dt>Macintosh file type code(s):</dt>
    <dd>
      <p>None. </p>
    </dd>
    <dt>Person &amp; email address to contact for further information:</dt>
    <dd>
      <p>Steven Pemberton, <a href="mailto:member-webapps@w3.org">member-webapps@w3.org</a></p>
    </dd>
    <dt>Intended usage: </dt>
    <dd>
      <p>Common. </p>
    </dd>
    <dt>Restrictions on usage: </dt>
    <dd>
      <p>None.</p>
    </dd>
    <dt>Author:</dt>
    <dd>
      <p><a href="http://www.w3.org/2008/webapps/">The W3C's Web Applications Working Group</a></p>
    </dd>
  </dl>
  <h3 class="no-num" id="linking-to-a-widget-package-from-a-html-document">Linking To a Widget Package From a HTML Document</h3>
  <p><em>This section is non-normative.</em></p>
  <p><em>This section only applies to HTML user agents <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">[HTML]</a>.</em></p>
  <p><dfn id="auto-discovery">Auto-discovery</dfn> enables a user agent to identify and install a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> that is associated with an HTML page. When a page points to
    a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>, user agents <em class="ct">should</em> expose the presence of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a> to the end-user and allow the end-user to install the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget">widget</a>.</p>
  <p>The link type "<code title="">widget</code>" indicates that a link of this type
    references a document that is a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-package">widget package</a>. In HTML, it may be
    specified for the <code title="">a</code>, <code title="">area</code> and <code title="">link</code> elements to create a hyperlink.</p>
  <div class="example">
    <p>For example:</p>
    <pre><code>&lt;a rel="widget"
   href="http://example.org/exampleWidget"&gt;
   The Example Widget
&lt;/a&gt;</code>
</pre>
  </div>
  <h3 class="no-num" id="table-of-elements-and-their-attributes">Table of Elements and Their Attributes</h3>
  <p><em>This section is non-normative.</em></p>
  <p>This table lists all elements and respective attributes, as well as child-parent relationships, that make up the language of the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a> format defined in this specification. </p>
  <table>
    <tbody><tr>
      <th scope="col">Element</th>
      <th scope="col">Description</th>
      <th scope="col">Parent</th>
      <th scope="col">Expected Children</th>
      <th scope="col">Attributes</th>
      <th scope="col">Type</th>
    </tr>
    <tr>
      <td rowspan="8"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="8">The root element of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#configuration-document-0">configuration document</a>.</td>
      <td rowspan="8">none. </td>
      <td rowspan="8"><ul>
          <li><code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code></li>
          <li><code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code></li>
          <li><code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author </a></code></li>
          <li><code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license </a></code></li>
          <li><code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code></li>
          <li><code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code></li>
          <li><code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code></li>
          <li><code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="widget id"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-id-attribute">id</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute" title="IRI attribute">IRI</a></td>
    </tr>
    <tr>
      <td><code title="widget version"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-version">version</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#version-attribute" title="version attribute">version</a></td>
    </tr>
    <tr>
      <td><code title="widget height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-height">height</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#numeric-attribute" title="numeric attribute">numeric</a></td>
    </tr>
    <tr>
      <td><code title="widget width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widget-width">width</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#numeric-attribute" title="numeric attribute">numeric</a></td>
    </tr>
    <tr>
      <td><code title="widget viewmodes"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-viewmodes-attribute">viewmodes</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-list-attribute" title="keyword list attribute">Keyword list</a></td>
    </tr>
    <tr>
      <td><code title="widget defaultlocale"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-defaultlocale-attribute">defaultlocale</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td rowspan="3"><code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code></td>
      <td rowspan="3">The name of the widget. </td>
      <td rowspan="3"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="3"><ul>
          <li><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code>, </li>
          <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node">text node</a></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="name short"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-short-attribute">short</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#displayable-string-attribute" title="displayable-string attribute">displayable-string</a></td>
    </tr>
    <tr>
      <td rowspan="2"><code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code></td>
      <td rowspan="2">Some text that describes the purpose of the widget.</td>
      <td rowspan="2"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="2"><ul>
          <li><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code></li>
          <li> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node">text node</a></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td rowspan="4"><code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code></td>
      <td rowspan="4">The person or person that created the widget.</td>
      <td rowspan="4"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="4"><ul>
          <li><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code></li>
          <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node">text node</a></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="author-element href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute">href</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute" title="IRI attribute">IRI</a></td>
    </tr>
    <tr>
      <td><code title="author email"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-email-attribute">email</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute" title="string attribute">string</a></td>
    </tr>
    <tr>
      <td rowspan="3"><code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code></td>
      <td rowspan="3">The license under which the widget is distributed.</td>
      <td rowspan="3"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="3"><ul>
          <li><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code></li>
          <li><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node">text node</a></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="license href"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-href-attribute-0">href</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#iri-attribute" title="IRI attribute">IRI</a> or <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute" title="path attribute">path</a></td>
    </tr>
    <tr>
      <td rowspan="5"><code title="icon element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-icon-element-and-its-attributes">icon</a></code></td>
      <td rowspan="5">An iconic representation of the widget.</td>
      <td rowspan="5"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="5">none.</td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="icon src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute">src</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#path-attribute" title="path attribute">path</a></td>
    </tr>
    <tr>
      <td><code title="icon width"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-width-attribute-0">width</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#numeric-attribute" title="numeric attribute">numeric</a></td>
    </tr>
    <tr>
      <td><code title="icon height"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-height-attribute-0">height</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#numeric-attribute" title="numeric attribute">numeric</a></td>
    </tr>
    <tr>
      <td rowspan="5"><code title="content element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-content-element-and-its-attributes">content</a></code></td>
      <td rowspan="5">The means to point to the "main file" of a widget; serves as a boot-strapping mechanism. </td>
      <td rowspan="5"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="5">none.</td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="content src"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-src-attribute-0">src</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#numeric-attribute" title="numeric attribute">numeric</a></td>
    </tr>
    <tr>
      <td><code title="content type"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-type-attribute">type</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#media-type-attribute" title="Media type attribute">media type</a></td>
    </tr>
    <tr>
      <td><code title="content encoding"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-encoding-attribute">encoding</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td rowspan="4"><code title="feature element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-feature-element-and-its-attributes">feature</a></code></td>
      <td rowspan="4">A means  to request the availability of a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>, such as an API, that would not normally be part of the default set of features provided by the user agent at runtime. </td>
      <td rowspan="4"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="4"><ul>
          <li><code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code>.</li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="feature name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute">name</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="feature required"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-required-attribute">required</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#boolean-attribute" title="boolean attribute">boolean</a></td>
    </tr>
    <tr>
      <td rowspan="5"><code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">preference</a></code></td>
      <td rowspan="5">A means to declare a name-value pair that is made available to the widget at runtime.</td>
      <td rowspan="5"><code title="widget element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-widget-element-and-its-attributes">widget</a></code></td>
      <td rowspan="5">none.</td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="preference name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-1">name</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="preference value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute-0">value</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="preference readonly"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-readonly-attribute">readonly</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#boolean-attribute" title="boolean attribute">boolean</a></td>
    </tr>
    <tr>
      <td rowspan="4"><code title="param element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-param-element-and-its-attributes">param</a></code></td>
      <td rowspan="4">A means of declaring a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#parameter">parameter</a> that can be used with a <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#feature">feature</a>. </td>
      <td rowspan="4"><code title="preference element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-preference-element-and-its-attributes">feature</a></code></td>
      <td rowspan="4">none.</td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
    <tr>
      <td><code title="param name"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-attribute-0">name</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute" title="string attribute">string</a></td>
    </tr>
    <tr>
      <td><code title="param value"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-value-attribute">value</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#string-attribute" title="string attribute">string</a></td>
    </tr>
    <tr>
      <td rowspan="2"><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code></td>
      <td rowspan="2">A generic text container which is mainly used for internationalization purposes. </td>
      <td rowspan="2"><ul>
          <li><code title="name element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-name-element-and-its-attributes">name</a></code></li>
          <li><code title="description element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-description-element-and-its-attributes">description</a></code></li>
          <li><code title="author element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-author-element-and-its-attributes">author</a></code></li>
          <li><code title="license element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-license-element-and-its-attributes">license</a></code></li>
        </ul></td>
      <td rowspan="2"><ul>
          <li><code title="span element"><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-span-element-and-its-attributes">span</a></code></li>
          <li> <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#text-node">text node</a></li>
        </ul></td>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-xml:lang-attribute">xml:lang</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#language-attribute" title="language attribute">language</a></td>
    </tr>
    <tr>
      <td><code><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#the-dir-attribute">dir</a></code></td>
      <td><a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#keyword-attribute" title="keyword attribute">keyword</a></td>
    </tr>
  </tbody></table>
  <h2 class="no-num" id="acknowledgements">Acknowledgements</h2>
  <p>Huge thanks to everyone who contributed their time and sent feedback to our public mailing, particularly the i18n WG. </p>
  <p>This specification would not exist without the contribution of the following individuals:</p>
  <p>Aaron Boodman,  Adam Barth, Addison Phillips, Alexander Dreiling, Andrew Sledd, Andrew Welch, Arun Ranganathan, Arthur Barstow, Bárbara
    Barbosa Neves, Bil Corry, Brian Wilson, Bjoern Hoehrmann, Benoit Suzanne, Bert Bos, Boris Zbarsky,
    Bradford Lassey, Bryan Sullivan,  Cameron McCormack, Cliff Schmidt, Claudio Venezia, Coach Wei, Corin
    Edwards, Cynthia Shelly, Cyril Concolato,  Dan Brickley, Dan Connolly, Daniel Silva, David Clarke, Dean Jackson, David Poehlman, David Pollington, David Rogers, Dominique Hazael-Massieux, Doug Schepers, Ed 
    Voas, Felix Sasaki, Francois Daoust, Frederick Hirsch, Gautam Chandna, Geir Pedersen, Gene Vayngrib, Gorm
    Haug Eriksen, Guido Grassel, Guenter Klas, Hans S. Tømmerholt, Hari Kumar G, Henri Sivonen, Henry Story, Ian Hickson, Ivan Demarino,  Jay Sweeney, Jean-Claude Dufourd, Jeff Decker, Jere Käpyaho,  Jim
    Ley, Jo Rabin, Jon Ferraiolo, Jonas Sicking, Jose Manuel Cantera Fonseca, Josh Soref, Jouni Hakala, Joey
    Bacalhau, Julian Reschke, Kevin Lawver, Kai Hendry, Krzysztof Maczyński, Lachlan Hunt, Larry Masinter, Laurens Holst, Mark Priestley, Marc Silbey,
    Marcin Hanclik, Mark Baker, Martin J. Dürst, Michael Cooper, Max Froumentin, Mikko Pohja, Mohamed Zergaoui, Ms2ger, Najib Tounsi, Noah Mendelsohn, Oguz Kupusoglu, Ola Andersson, Olli Immonen, Paddy Byers, Paul Libbrecht , Philipp
    Heltewig, Philip Taylor, Rainer Hillebrand, Robert Sayre, Rune <abbr title="Fabulous">F.</abbr> Halvorsen,  Samuel Santos, Scott Wilson, Sean Mullan, Sigbjorn Finne, Simon Pieters, Stephen Paul Weber, Stephen Jolly, Stephane Sire, Steven Faulkner, Thomas Landspurg, Thomas Roessler, Tiago Neves, William Edney, Yoan Blanc, Yves Savourel.</p>
  <p>Special thanks go to Arve Bersvendsen, Robin Berjon, Anne van Kesteren, and Charles
    McCathieNevile who helped edit various versions of this specification. Big thanks also to Richard Tibbett.  </p>
  <p>Special thanks also to <a href="http://hasather.net/">David Håsäther</a> for
    creating and maintaining the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#widgets-relax-ng-schema">[Widgets-Relax NG Schema]</a> for the configuration document format.</p>
  <p>Parts of this document reproduce text and behavior from the <a href="http://www.w3.org/TR/2012/REC-widgets-20121127/#html">[HTML]</a> specification and from the <a href="http://www.w3.org/TR/xbl/">XBL 2.0
    specification</a> (as permitted by both specifications by their copyright
    statements).</p>
  <p>Graphic icons used some examples of this specification were created by <a href="http://www.pinvoke.com/">Yusuke Kamiyamane</a> and are available for use under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0
    license</a>.</p>
  <p>This specification is dedicated to the children of India.</p>
  <h2 class="no-num" id="normative-references">Normative References</h2>
<dl><dt><dfn id="abnf">[ABNF]</dfn></dt>
    <dd><a href="http://www.ietf.org/rfc/rfc5234.txt"><cite>Augmented BNF for Syntax
      Specifications: <abbr title="Augmented Backus-Naur Form">ABNF</abbr></cite></a>.
      RFC5234. D. Crocker and P. Overell. January 2008.</dd>
    <dt><dfn id="bidi">[BIDI]</dfn></dt>
    <dd><cite><a href="http://unicode.org/reports/tr9/">Unicode Standard Annex #9: Unicode Bidirectional Algorithm</a></cite>. M. Davis.</dd>
    <dt><dfn id="bcp47">[BCP47]</dfn></dt>
    <dd><cite><a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">Tags for Identifying Languages</a></cite>, A. Phillips and M. Davis. September 2009.</dd>
    <dt><dfn id="cp437">[CP437]</dfn></dt>
    <dd><cite><a href="ftp://ftp.software.ibm.com/software/globalization/gcoc/attachments/CP00437.txt">IBM CPGID 00437</a></cite>. Code Page 47, Character Encoding Scheme. 1984. </dd>
    <dt><dfn id="css2">[CSS]</dfn></dt>
    <dd><cite><a href="http://www.w3.org/TR/CSS21/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>.</cite> B. Bos, I. Hickson, T.
      Çelik, H. Wium Lie.  W3C Recommendation 07 June 2011.</dd>
    <dt><dfn id="css-mime">[CSS-MIME]</dfn></dt>
    <dd><cite><a href="http://www.rfc-editor.org/rfc/rfc2318.txt">The text/css Media Type </a></cite>. RFC 2318. H. Lie,  B. Bos, and C. Lilley. IETF. March 1998.</dd>
    <dt><dfn id="deflate">[Deflate]</dfn></dt>
    <dd><a href="http://www.faqs.org/rfcs/rfc1951.html"><cite>DEFLATE Compressed Data
      Format Specification version 1.3</cite></a>. P. Deutsch, The Internet Society, May
      1996.</dd>
    <dt><dfn id="dom3core">[DOMCore]</dfn></dt>
    <dd><a href="http://www.w3.org/TR/DOM-Level-3-Core/"><cite>Document Object Model
      (DOM) Level 3 Core Specification</cite></a>. A. Le Hors, P. Le Hégaret, L. Wood, G.
      Nicol, J. Robie, M. Champion, S. Byrne, editors. W3C Recommendation 07 April 2004.</dd>
    <dt><dfn id="iana-charsets">[IANA-Charsets]</dfn></dt>
    <dd><a href="http://www.iana.org/assignments/character-sets"><cite>IANA Character Set
      Registry</cite></a>.</dd>
    <dt><dfn id="iri">[IRI]</dfn></dt>
    <dd><cite><a href="http://www.ietf.org/rfc/rfc3987">Internationalized Resource
      Identifiers (IRIs)</a></cite>. RFC3987, M. Duerst, M. Suignard. January 2005.</dd>
    <dt><dfn id="mime">[MIME]</dfn></dt>
    <dd><a href="http://www.ietf.org/rfc/rfc2045.txt"><cite>Multipurpose Internet Mail
      Extensions (MIME) Part One: Format of Internet Message Bodies</cite></a>. RFC2045, N.
      Freed and N. Borenstein, IETF, November 1996.</dd>
    <dd><a href="http://www.ietf.org/rfc/rfc2046.txt"><cite>Multipurpose Internet Mail
      Extensions(MIME) Part Two: Media Types</cite></a>. RFC2046, N. Freed and N.
      Borenstein, IETF, November 1996.</dd>
    <dt><dfn id="rfc2119">[RFC2119]</dfn></dt>
    <dd><a href="http://www.ietf.org/rfc/rfc2119"><cite>Key words for use in RFCs to
      Indicate Requirement Levels</cite></a>. RFC2119, S. Bradner. March 1997.</dd>
    <dt><dfn id="sniff">[SNIFF]</dfn></dt>
    <dd><a href="http://tools.ietf.org/html/draft-ietf-websec-mime-sniff"><cite>Media Type Sniffing</cite></a>. A. Barth and I. Hickson. IETF (Work in Progress).</dd>
   
    <dt><dfn id="unicode">[Unicode]</dfn></dt>
    <dd> <cite><a href="http://www.unicode.org/versions/latest/">The Unicode Standard</a></cite>. Unicode Consortium.</dd>
    <dt><dfn id="uri">[URI]</dfn></dt>
    <dd><a href="http://www.ietf.org/rfc/rfc3986.txt"><cite>Uniform Resource Identifier
      (URI): Generic Syntax</cite></a>. RFC 3986, T. Berners-Lee, R. Fielding and L.
      Masinter. January 2005.</dd>
    <dt><dfn id="utf-8">[UTF-8]</dfn></dt>
    <dd><cite><a href="http://www.ietf.org/rfc/rfc3629.txt">UTF-8: A Transformation
      format of ISO 1064</a></cite>. RFC 3629, F. Yergeau. IETF, November 2003.</dd>
  
    <dt><dfn id="widgets-digsig">[Widgets-DigSig]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-digsig/"><cite>XML Digital
      Signatures for Widgets</cite></a>. M. Cáceres, Paddy Byers, Stuart Knightley, F. Hirsch, and M. Priestley. W3C  Proposed Recommendation.</dd>
    <dt><dfn id="view-modes">[View-Modes]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-vmmf/"><cite>The 'view-mode' Media Feature</cite></a>.  R. Berjon and M. Cáceres.   W3C Recommendation. </dd>
    <dt><dfn id="xml">[XML]</dfn></dt>
    <dd><cite><a href="http://www.w3.org/TR/2008/REC-xml-20081126/">Extensible Markup
      Language (XML) 1.0 (Fifth Edition)</a></cite>. T. Bray, J. Paoli, C. M.
      Sperberg-McQueen, E. Maler, F. Yergeau. W3C Recommendation 26 November 2008.</dd>
    <dt><dfn id="xml-mime">[XML-MIME]</dfn></dt>
    <dd><a href="http://www.rfc-editor.org/rfc/rfc3023.txt"><cite>XML Media Types</cite></a>. RFC3023. M. Murata, S. St. Laurent,  D. Kohn. IETF. January 2001. </dd>
    <dt><dfn id="xmlns">[XMLNS]</dfn></dt>
    <dd><a href="http://www.w3.org/TR/2006/REC-xml-names-20060816/"><cite>Namespaces in
      XML (Second Edition)</cite></a>. T. Bray, D. Hollander, A. Layman, R. Tobin. W3C Recommendation,
      August 2006.</dd>
    <dt><dfn id="zip">[ZIP]</dfn> </dt>
    <dd><a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT"><cite>.Zip File
      Format Specification</cite></a>. PKWare Inc.</dd>
    <dt><dfn id="zip-mime">[ZIP-MIME]</dfn></dt>
    <dd><a href="http://www.iana.org/assignments/media-types/application/zip">IANA Media Type
      Assignment.</a></dd>
  </dl>
  <h2 class="no-num" id="informative-references">Informative References</h2>
 <dl><dt><dfn id="ecmascript-mime">[ECMAScript-MIME]</dfn></dt>
    <dd><a href="http://www.rfc-editor.org/rfc/rfc4329.txt"><cite>Scripting Media Types</cite></a>. RFC4329. B. Hoehrmann. IETF. April 2006.</dd>
    <dt><dfn id="html">[HTML]</dfn></dt>
 	  <dd><cite><a href="http://www.w3.org/TR/html5/">HTML5</a></cite>. Ian Hickson. W3C Working Draft 25 May 2011.</dd>     
      <dd><cite><a href="http://www.whatwg.org/specs/web-apps/current-work/">HTML - Living Standard</a></cite>.  I. Hickson. WHATWG. </dd>
    <dt><dfn id="html-mime">[HTML-MIME]</dfn></dt>
    <dd><a href="http://www.rfc-editor.org/rfc/rfc2854.txt">The 'text/html' Media Type</a>. D. Connolly and L. Masinter. IETF. June 2000.</dd>
    <dt><dfn id="http">[HTTP]</dfn></dt>
    <dd><a href="http://www.ietf.org/rfc/rfc2616.txt"><cite>Hypertext Transfer Protocol
      -- HTTP/1.1</cite></a>. RFC 2616, R. Fielding, et al. June 1999.</dd>
    <dt><dfn id="svgtiny">[SVGTiny]</dfn></dt>
    <dd><cite><a href="http://www.w3.org/TR/2008/REC-SVGTiny12-20081222/">Scalable Vector
      Graphics (SVG) Tiny 1.2 Specification</a></cite>. O. Andersson, R. Berjon, E.
      Dahlström, A. Emmons, J. Ferraiolo, A. Grasso, V. Hardy, S. Hayman, D. Jackson, C.
      Lilley, C. McCormack, A. Neumann, C. Northway, A. Quint, N. Ramani, D. Schepers, A.
      Shellshear. W3C Recommendation, 22 December 2008.</dd>
    <dt><dfn id="refsUTR">[UTR36]</dfn></dt>
    <dd><cite><a href="http://unicode.org/reports/tr36/">UTR #36: Unicode
      Security Considerations</a></cite>, M. Davis, M. Suignard. Unicode
      Consortium.</dd>
    <dt><dfn id="widgets-landscape">[Widgets-Landscape]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-land/"><cite>The Widget
      Landscape (Q1 2008)</cite></a>. M. Cáceres. W3C Note.</dd>
    <dt><dfn id="widgets-requirements">[Widgets-Requirements]</dfn></dt>
    <dd><cite><a href="http://dev.w3.org/2006/waf/widgets-reqs/">Widgets Requirements</a></cite>, M. Cáceres and M. Priestley. W3C Note.</dd>
    <dt><dfn id="widgets-relax-ng-schema">[Widgets-Relax NG Schema]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-schema/widgets.rnc"><cite>Relax NG Schema for the Widgets Family of Specifications</cite></a>. D. Håsäther, R. Berjon, and M. Cáceres.</dd>
    <dt><dfn id="widgets-test-suite">[P&amp;C-Test-Suite]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets/test-suite/"><cite>Test Suite for Widget Packaging and XML Configuration</cite></a>. M. Cáceres. </dd>
    <dt><dfn id="widgets-apis">[Widgets-APIs]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-api/"><cite>The Widget Interface</cite></a>.  M. Cáceres.  
      (Work in progress).</dd>
    <dt><dfn id="widgets-uri">[Widgets-URI]</dfn></dt>
    <dd><a href="http://dev.w3.org/2006/waf/widgets-uri/"><cite>Widget URI Scheme</cite></a>. M. Cáceres.  W3C Note.</dd>
  </dl>
</div>
<!-- script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="../widgets-shared/javascript/viewTests.js"></script-->


</body></html>